I just started messing around with Arduino Leonardo and have been working with a photoresistor. while i do get a value returned to the serial monitor, I don't believe the value to be correct. I disconnected Leonardo from the circuit, and still get a serial monitor return of around 300. attached is my code. am i doing something wrong or am i just missing something? Thanks !
lnt lightSensor = A0;
int light_val;
void setup() {
Serial.begin(9600);
while (!Serial);//wait untill serial is ready
Serial.println ("standby");
}
light_val = analogRead(lightSensor); // read the value from the photosensor
Serial.print("light sensor reads ");
Serial.println( light_val );
delay(1000);
}