Products
Application Hints
Libraries
Errata
Blink
The "Blink" sketch flashes an LED every second. To run "Blink" on the
ZB1 just change the LED from pin 13 to pin 7. Make sure that the
jumper J3 is in the "7" position.
Blink Program Listing
/*
* Blink
*
* Modified from the Arduino Blink sketch.
*
* Turns an LED on for one second, then off for one second,
* and so on...
*
* When J3 has a jumper in the Pin 7 position the status LED
* on the ZB1 is connected to Pin 7 (PD7) through a series
* resistor.
*
*/
int ledPin = 7; // LED connected to PD7
void setup() // run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
digitalWrite(ledPin, HIGH);
}
void loop() // run over and over again
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}