Professional Documents
Culture Documents
// the setup function runs once when you press reset or power the board
int led = 13;
void setup() {
// initialize digital pin 13 as an LED output.
pinMode(led, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(led, HIGH); // turn the LED on by making the voltage HIGH
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Alternate LEDs blinking control through programming using Arduino mega-2560 board.
// the setup function runs once when you press reset or power the board
int LED1 =13, LED2=11;
void setup() {
// initialize digital pins 13 and 11 as LED1 and LED2 outputs.
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
}