Advertisement
Guest User

Untitled

a guest
May 27th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 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(13, OUTPUT);
  5. pinMode(12, OUTPUT);
  6. }
  7.  
  8. // the loop function runs over and over again forever
  9. void loop() {
  10. int start = 10;
  11. int i = 0;
  12. for (int i=start; i >= 0; i--) {
  13. digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
  14. //digitalWrite(12, HIGH);
  15. delay(i); // wait for a second
  16. digitalWrite(13, LOW);
  17. //digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
  18. delay(i);
  19. }
  20. for (int i=0; i <= start; i= i+5) {
  21. digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
  22. digitalWrite(12, HIGH);
  23. delay(i); // wait for a second
  24. digitalWrite(13, LOW);
  25. digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
  26. delay(i);
  27. }
  28. }
  29.  
  30. /**
  31. int maxv = random(1,20);
  32. int minv = random(0, maxv);
  33. int timevalue = random(minv, maxv);
  34. digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
  35. delay(timevalue); // wait for a second
  36. timevalue = random(minv, timevalue);
  37. digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
  38. delay(timevalue); // wait for a second
  39. timevalue = random(minv, timevalue);
  40. digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
  41. delay(timevalue);
  42. timevalue = random(minv, timevalue);
  43. digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
  44. delay(timevalue); // wait for a second **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement