Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. */
  2.   Blink_2
  3.   Turns one LED on for one second and the other for one second too,
  4.   one in each time.
  5.  
  6.   This example code is in the public domain.
  7.  */
  8.  
  9. void setup() {                
  10.   // initialize the digital pin as an output.
  11.   // Pin 13 has an LED connected on most Arduino boards:
  12.   pinMode(13, OUTPUT);
  13.   // initialize the digital pin 12 as an output.  
  14.   pinMode(12, OUTPUT);
  15. }
  16.  
  17. void loop() {
  18.   digitalWrite(13, HIGH);   // set the LED at pin 13 on
  19.   digitalWrite(12, LOW);    // set the LED at pin 12 off
  20.   delay(1000);              // wait for a second
  21.   digitalWrite(13, LOW);    // set the LED at pin 13 off
  22.   digitalWrite(12, HIGH);   // set the LED at pin 13 on
  23.   delay(1000);              // wait for a second
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement