const int ldr = 15;
int adcLdr = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(ldr, INPUT);
}
void loop() {
adcLdr = analogRead(ldr);
Serial.print("ADC : ");
Serial.println(adcLdr);
Serial.print("Lux : ");
Serial.println((0.00003*pow(adcLdr,2))-(0.2312*adcLdr)+444.14);
// put your main code here, to run repeatedly:
delay(100); // this speeds up the simulation
}