Fitlight trainer using arduino

Hello everyone,

I'm currently working on a prototype for which I have to connect 5 LDR's to 5 LED's. These LED's have to be randomly turned on and off. When one is covered the next one will turn on and so on, it's a game it is like fit light trainer. Since I'm a student I do not have much experience yet and I hope that someone is able to help me or give me some advice what to look for.

int LDR = 0;
int LDRValue = 0;
int light_sensor = 20;
int myPins[] = {2, 3, 4, 5, 6};

void setup()
{
Serial.begin(9600);
pinMode(myPins[LDR], OUTPUT);
}

void loop()
{
LDRValue = analogRead(LDR);
Serial.println(LDRValue);
delay(50);

for (LDR = 0; LDR < 5; LDR = LDR++)
{
LDRValue = analogRead(LDR);
Serial.println(LDRValue);

if (LDRValue > light_sensor) {
digitalWrite(myPins[LDR], HIGH);
} else {
digitalWrite(myPins[LDR], LOW);
}
delay(50);
}
}

I'm searching for a solution for the exact same thing. Did u come up with something? Did u actually build a fitlight-unit?

Thanks in advance!

Hi,
I have some students working on this. Let me know if you find anything about sensing the human's 'touch / near' sensing..