Advertisement
maheshs

blink

Oct 21st, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. //code:by mahesh.s
  2. /*
  3. police sound and Blink.......
  4. Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain.
  5. */
  6.  
  7. // Pin 13 has an LED connected on most Arduino boards.
  8. // give it a name:
  9. int led = 13;
  10. int led2=12;
  11. // the setup routine runs once when you press reset:
  12. void setup() { // initialize the digital pin as an output.
  13. pinMode(led, OUTPUT); pinMode(led2, OUTPUT);
  14.  
  15. //connect the buzer in pin 12 or 13
  16. }
  17.  
  18. // the loop routine runs over and over again forever:
  19. void loop() {
  20. digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
  21. delay(100); // wait for a second
  22. digitalWrite(led2, HIGH); // turn the LED on (HIGH is the voltage level)
  23. delay(100); // wait for a second
  24.  
  25. digitalWrite(led,LOW); // turn the LED off by making the voltage LOW
  26. delay(100); // wait for a second
  27. digitalWrite(led2,LOW); // turn the LED off by making the voltage LOW
  28. delay(100); // wait for a second
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement