Add example for teensy boards

This commit is contained in:
Valeriy Koval
2015-02-16 17:35:40 +02:00
parent 2b924d1573
commit 639ee9fc47
2 changed files with 70 additions and 0 deletions

View 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

View 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
}