Guest User

Untitled

a guest
Nov 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. /*
  2. Blink
  3. Turns on an LED on for one second, then off for one second, repeatedly.
  4.  
  5. This example code is in the public domain.
  6. */
  7.  
  8. // Pin 13 has an LED connected on most Arduino boards.
  9. // Pin 11 has the LED on Teensy 2.0
  10. // Pin 6 has the LED on Teensy++ 2.0
  11. // Pin 13 has the LED on Teensy 3.0
  12. // give it a name:
  13. int b1 = 2;
  14. int b2 = 3;
  15. int b3 = 4;
  16. int b4 = 5;
  17.  
  18.  
  19. // the setup routine runs once when you press reset:
  20. void setup() {
  21. // initialize the digital pin as an output.
  22. pinMode(b1, OUTPUT);
  23. pinMode(b2, OUTPUT);
  24. pinMode(b3, OUTPUT);
  25. pinMode(b4, OUTPUT);
  26.  
  27.  
  28.  
  29. }
  30.  
  31. // the loop routine runs over and over again forever:
  32. void loop() {
  33. digitalWrite(b1, HIGH); // turn the LED on (HIGH is the voltage level)
  34. delay(100); // wait for a second
  35. digitalWrite(b1, LOW); // turn the LED off by making the voltage LOW
  36. delay(6000); // wait for a second
  37.  
  38. digitalWrite(b2, HIGH); // turn the LED on (HIGH is the voltage level)
  39. delay(100); // wait for a second
  40. digitalWrite(b2, LOW); // turn the LED off by making the voltage LOW
  41. delay(5000);
  42.  
  43. digitalWrite(b3, HIGH); // turn the LED on (HIGH is the voltage level)
  44. delay(100); // wait for a second
  45. digitalWrite(b3, LOW); // turn the LED off by making the voltage LOW
  46. delay(8000);
  47.  
  48. digitalWrite(b4, HIGH); // turn the LED on (HIGH is the voltage level)
  49. delay(100); // wait for a second
  50. digitalWrite(b4, LOW); // turn the LED off by making the voltage LOW
  51. delay(5000);
  52.  
  53.  
  54. }
Add Comment
Please, Sign In to add comment