Fitlight trainer using arduino Answered
I want to make a fitlight trainer with arduino. I want to make it with leds and LDR ligtht sensors. A random light pops up and when you hover over the sensor it sets it to LOW and then another random light pops up and over and over.
Can anyone help me with this idea?
I have the code for one light:
int LDR = 0; //analog pin to which LDR is connected, here we set it to 0 so it means A0
int LDRValue = 0; //that’s a variable to store LDR values
int light_sensitivity = 20; //This is the approx value of light surrounding your LDR
LDRValue = analogRead(LDR); //reads the ldr’s value through LDR
Serial.println(LDRValue); //prints the LDR values to serial monitor
delay(50); //This is the speed by which LDR sends value to arduino
if (LDRValue > light_sensitivity)