#define GAMMA 0.7
#define RL10 50
#define LDR 12
void setup() {
Serial.begin(115200);
pinMode(LDR, INPUT);
}
void loop() {
int Lectura = analogRead(LDR);
float Voltaje = Lectura / 4095. * 5;
float R = 2000 * Voltaje / (1 - Voltaje / 5);
float Lux = pow(RL10 * 1e3 * pow(10, GAMMA) / R, (1 / GAMMA));
Serial.println("Votaje: "+String(Voltaje));
Serial.println("Resistencia: "+String(R));
Serial.println("Lux: "+String(Lux));
delay(500);
}