
The purpose of this tutorial is to flash an LED through the Arduino board: illuminate and switch off the LED alternately at 1 second intervals.
As for mounting, it is easy to connect LEDs to Arduino.
1 2 3 4 5 6 7 8 9 |
void setup(){ pinMode(1,OUTPUT); //sets the number 1 digital pin of the Arduino board in output mode } void loop(){ digitalWrite(1,HIGH); //The LED lights delay(1000); digitalWrite(1,LOW); // The LED goes out delay(1000); } |