//Potentiometer is connected to GPIO 34 (Analog ADC1_CH6)
const int potPin = 34;
const int ldrPin = 39;
float potValue = 0;
int ldrValue = 0;
hw_timer_t *My_timer = NULL;
void IRAM_ATTR onTimer() {
Serial.printf("0.00, 3.30, %d, %.2f\n", ldrValue, potValue);
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
My_timer = timerBegin(0, 80, true);
timerAttachInterrupt(My_timer, &onTimer, true);
timerAlarmWrite(My_timer, 10000, true);
timerAlarmEnable(My_timer);
}
void loop() {
potValue = analogRead(potPin);
ldrValue = analogRead(ldrPin);
}