Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. // the setup function runs once when you press reset or power the board
  2. void setup() {
  3. // initialize digital pin LED_BUILTIN as an output.
  4. pinMode(LED_BUILTIN, OUTPUT);
  5.  
  6. pinMode(2, OUTPUT);
  7. pinMode(3, OUTPUT);
  8.  
  9. pinMode(5, OUTPUT);
  10. pinMode(6, OUTPUT);
  11.  
  12. pinMode(A0, OUTPUT);
  13. pinMode(A1, OUTPUT);
  14. pinMode(A2, OUTPUT);
  15. pinMode(A3, OUTPUT);
  16. digitalWrite(A1, OUTPUT);
  17. }
  18.  
  19. // the loop function runs over and over again forever
  20. void loop() {
  21. digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
  22. delay(100); // wait for a second
  23. digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
  24. delay(100); // wait for a second
  25.  
  26. digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
  27. delay(100); // wait for a second
  28. digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
  29. delay(100); // wait for a second
  30.  
  31. digitalWrite(5, HIGH); // turn the LED on (HIGH is the voltage level)
  32. delay(100); // wait for a second
  33. digitalWrite(5, LOW); // turn the LED off by making the voltage LOW
  34. delay(100); // wait for a second
  35.  
  36.  
  37. digitalWrite(A0, LOW); // turn the LED on (HIGH is the voltage level)
  38. delay(100); // wait for a second
  39. digitalWrite(A0, HIGH); // turn the LED off by making the voltage LOW
  40. delay(100);
  41.  
  42. digitalWrite(A1, LOW); // turn the LED on (HIGH is the voltage level)
  43. delay(100); // wait for a second
  44. digitalWrite(A1, HIGH); // turn the LED off by making the voltage LOW
  45. delay(100);
  46.  
  47. digitalWrite(A2, LOW); // turn the LED on (HIGH is the voltage level)
  48. delay(100); // wait for a second
  49. digitalWrite(A2, HIGH); // turn the LED off by making the voltage LOW
  50. delay(100);
  51.  
  52.  
  53. digitalWrite(A3, LOW); // turn the LED on (HIGH is the voltage level)
  54. delay(100); // wait for a second
  55. digitalWrite(A3, HIGH); // turn the LED off by making the voltage LOW
  56. delay(100);
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement