random running lights


Does anybody have a code, or knows were i can download a code for a simple or random running lights? (8 to 10 LED)


You can use this, and adjust ?? http://www.instructables.com/id/8-LED-Larson-Scanner-with-Arduino/

"simple or random" Are the two exclusive?

loop ()
  Generate a random number
  Use the last three digits, (which will always be {0,1,...7}, as an "element pointer" for an array (of possible output pins)
  digitalWrite that array element pointed to
  delay(your preference)
  turn off that output

From my point of view, that's an example of simple and random.


I have done as you said, copied it various times, and modified timings in each loop, and I got my simple / random running lights.. :)