Difference between revisions of "Project LED Module"

From LinkSprite Playgound
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="c"> /* based on Blink, Arduino's "Hello World!" Turns on an LED on for one second, then off for one second, repeatedly. The Tinkerkit Led Modules...")
 
(No difference)

Latest revision as of 05:13, 24 November 2012

<syntaxhighlight lang="c">

/*

 based on Blink, Arduino's "Hello World!"
 Turns on an LED on for one second, then off for one second, repeatedly.
 The Tinkerkit Led Modules (T010110-7) is hooked up on O0


 This example code is in the public domain.
*/
  1. define O0 11
  2. define O1 10
  3. define O2 9
  4. define O3 6
  5. define O4 5
  6. define O5 3
  7. define I0 A0
  8. define I1 A1
  9. define I2 A2
  10. define I3 A3
  11. define I4 A4
  12. define I5 A5


void setup() {

 // initialize the digital pin as an output.
 // Pin 13 has an LED connected on most Arduino boards:
 pinMode(O0, OUTPUT);     

}

void loop() {

 digitalWrite(O0, HIGH);   // set the LED on
 delay(1000);              // wait for a second
 digitalWrite(O0, LOW);    // set the LED off
 delay(1000);              // wait for a second

}

</syntaxhighlight>