i am confused about how random works in arduino.
i see everyone using millis() as a seed, but that number is WAY too high for me.
i just want a random number between 0 and 18.
i'm excerpting some parts of my code, i know some of my variable choices might seem strange.
basically, given a user action, i want to turn off a random LED from among the LEDs that are currently off.
const int numLights = 9; //number of LEDs connected
long whichLight; //which LED i should turn on
long numOff = 9; //number of lights that are off
randomSeed(numLights);
whichLight = random(numOff);
digitalWrite(whichLight, HIGH);
by the way, can i use an int, instead of long, for random?
thanks so much,
aya.