/* LED Blink, Teensyduino Tutorial #1
[URL]http://www.pjrc.com/teensy/tutorial.html[/URL]
This example code is in the public domain.
*/
// Teensy 2.0 has the LED on pin 11
// Teensy++ 2.0 has the LED on pin 6
// Teensy 3.x / Teensy LC have the LED on pin 13
const int ledPin = 13;
const int fastPin = 14;
const int us = 1;
const int ns = 78; // 78 gives a 100 ns pulse
// the setup() method runs once, when the sketch starts
void setup() {
// initialize the digital pin as an output.
pinMode(ledPin, OUTPUT);
pinMode(fastPin, OUTPUT);
}
// the loop() runs over and over again,
// as long as the board has power
void loop() {
noInterrupts();
digitalWrite(ledPin, HIGH); // set the LED on
delay(500); // wait for 500 ms
digitalWrite(ledPin, LOW); // set the LED off
digitalWriteFast(fastPin, HIGH); // Fast pulse test
delayNanoseconds(ns);
digitalWriteFast(fastPin, LOW);
delay(500); // Wait and repeat.
}