mercredi 18 juin 2014

Arduino randome LED blinking


Vote count:

0




What is the code to blink arduino LED in random time periods?


basic arduino code available for blink LED in fixed time.


I am going to change that program to random time blinking.



asked 25 secs ago


1 Answer



Vote count:

0




This is the code



int led = 13;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(random(10, 500)); // wait
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(random(10, 500)); // wait
}


answered 25 secs ago





Aucun commentaire:

Enregistrer un commentaire