forked from platformio/platformio-core
Add example for teensy boards
This commit is contained in:
42
examples/teensy/teensy-blink/platformio.ini
Normal file
42
examples/teensy/teensy-blink/platformio.ini
Normal file
@ -0,0 +1,42 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:teensy20]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensy20
|
||||
build_flags = -DTEENSY20
|
||||
|
||||
[env:teensy20pp]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensy20pp
|
||||
build_flags = -DTEENSY20PP
|
||||
|
||||
[env:teensy30]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensy30
|
||||
build_flags = -DTEENSY30
|
||||
|
||||
[env:teensy31]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensy31
|
||||
build_flags = -DTEENSY31
|
28
examples/teensy/teensy-blink/src/Blink.pde
Normal file
28
examples/teensy/teensy-blink/src/Blink.pde
Normal file
@ -0,0 +1,28 @@
|
||||
/* LED Blink, Teensyduino Tutorial #1
|
||||
http://www.pjrc.com/teensy/tutorial.html
|
||||
|
||||
This example code is in the public domain.
|
||||
*/
|
||||
#ifdef TEENSY20
|
||||
const int ledPin = 11;
|
||||
#elif TEENSY20PP
|
||||
const int ledPin = 6;
|
||||
#else
|
||||
const int ledPin = 13;
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
// initialize the digital pin as an output.
|
||||
pinMode(ledPin, OUTPUT);
|
||||
}
|
||||
|
||||
// the loop() methor runs over and over again,
|
||||
// as long as the board has power
|
||||
|
||||
void loop() {
|
||||
digitalWrite(ledPin, HIGH); // set the LED on
|
||||
delay(300); // wait for a second
|
||||
digitalWrite(ledPin, LOW); // set the LED off
|
||||
delay(100); // wait for a second
|
||||
}
|
||||
|
Reference in New Issue
Block a user