Random leds blinking

Hello everybody…

I’m tryng to do a (I suppose) simple code…What I’m trying to do is to read a sensor ( photoresistor ) and then turn on one of three led i have on the bread board when a certain condition is met ( in this case the light variation )…

the difficulty is to make it random…meaning that arduino should “choose” randomly whic led to turn on.
I suppose i have to use progression (i++)…What i have in mind is to assign precise values to each led and then make aduino choose one of these value ( randomly ).

Problem is i have no ideas how to do this…all i managed to do is to make variation on the time of lighting of single led…

I hope you can help me

thanks a lot

i forgoto to put the code i managed to make:
[edit]int sensore = 5; // fotoresistore
int threshold = 700; // sensibilità fotoresistore
int ledPin = 13; // LED connected to digital pin 13

int value = 0;
long randOn = 0; // Initialize a variable for the ON time
long randOff = 0; // Initialize a variable for the OFF time

void setup() // run once, when the sketch starts
randomSeed (analogRead (0)); // randomize
pinMode(ledPin, OUTPUT); // sets the digital pin as output
pinMode(sensore, INPUT);

void loop() // run over and over again
randOn = random (100, 5000); // generate ON time between 0.1 and 5 seconds
randOff = random (200, 1900); // generate OFF time between 0.2 and 1.9 seconds

value=analogRead (sensore);

if (value > threshold){ digitalWrite(ledPin, HIGH); // sets the LED on
delay(randOn); // waits for a random time while ON

else {
digitalWrite(ledPin, LOW); // sets the LED off

this is a double post, see this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1215015592/2#2

Its not good form to post the same question in more than one place. Someone could spend time composing and posting a response to help only to then find that your question has already been answered in another thread.

soryy about that…

I won’t post the same question twice ever again…