Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Blink
- Turns on an LED on for one second, then off for one second, repeatedly.
- This example code is in the public domain.
- */
- #define LED1 38
- #define LED2 39
- #define LED3 40
- void setup() {
- // initialize the digital pin as an output.
- // Pin PIN_LED1 has an LED connected on most Arduino and compatible boards:
- pinMode(LED1, OUTPUT);
- pinMode(LED2, OUTPUT);
- pinMode(LED3, OUTPUT);
- }
- void loop() {
- digitalWrite(LED2, LOW); // set the LED on
- digitalWrite(LED3, LOW); // set the LED on
- digitalWrite(LED1, HIGH); // set the LED on
- delay(500); // wait for a second
- digitalWrite(LED1, LOW); // set the LED off
- digitalWrite(LED2, HIGH); // set the LED on
- delay(500); // wait for a second
- digitalWrite(LED2, LOW); // set the LED off
- digitalWrite(LED3, HIGH); // set the LED on
- delay(500);
- digitalWrite(LED3, LOW); // set the LED off
- digitalWrite(LED2, HIGH); // set the LED on
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement