int photoPin = A0;
float fixedResistor = 10000.0;
int dt = 1000;
void setup(){
Serial.begin(9600);
pinMode(photoPin, INPUT);
}
void loop(){
int photoValue = analogRead(photoPin);
// Conversion of analogValue which is between 0 to 1023 into analog voltagr
float photoResistance = (fixedResistor * (1023.0 - photoValue)) / photoValue;
float brightnessLevel = (photoValue/1023.0) * 100;
Serial.print(" Photo Resistor Value = ");
Serial.print(photoValue);
Serial.print(",");
Serial.print(" Resistance = ");
Serial.print(photoResistance);
Serial.print(", Brighness Level = ");
Serial.println(brightnessLevel);
delay(dt);
}