Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // the setup function runs once when you press reset or power the board
- void setup() {
- // initialize digital pin LED_BUILTIN as an output.
- pinMode(13, OUTPUT);
- pinMode(12, OUTPUT);
- }
- // the loop function runs over and over again forever
- void loop() {
- int start = 10;
- int i = 0;
- for (int i=start; i >= 0; i--) {
- digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
- //digitalWrite(12, HIGH);
- delay(i); // wait for a second
- digitalWrite(13, LOW);
- //digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
- delay(i);
- }
- for (int i=0; i <= start; i= i+5) {
- digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
- digitalWrite(12, HIGH);
- delay(i); // wait for a second
- digitalWrite(13, LOW);
- digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
- delay(i);
- }
- }
- /**
- int maxv = random(1,20);
- int minv = random(0, maxv);
- int timevalue = random(minv, maxv);
- digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(timevalue); // wait for a second
- timevalue = random(minv, timevalue);
- digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
- delay(timevalue); // wait for a second
- timevalue = random(minv, timevalue);
- digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(timevalue);
- timevalue = random(minv, timevalue);
- digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
- delay(timevalue); // wait for a second **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement