Voltage measurement with I35
Posted: Wed Nov 07, 2018 9:12 pm
Hi,
I work with Wemos D32 pro.
I would want to measure the battery voltage through the named _VBAT pin (= 35, see pins_arduino.h).
I have 2 push buttons connected to GPIO 25 and 26 ( = DAC 1, = DAC2), using internal pullup resistors and declared interrupts on falling edge.
When I read the voltage (analogRead(_VBAT)) it fires the ISR method of these two buttons, but not others (GPIO 32, 33, 00).
I suspect DAC to be "activated" when reading _VBAT, also I tried :
1/ to disable DAC :
2/ to disable interrupts and wait a little :
nothink worked !
Could someone help me ?
Am I wrong with the method to read voltage ?
Regards
I work with Wemos D32 pro.
I would want to measure the battery voltage through the named _VBAT pin (= 35, see pins_arduino.h).
I have 2 push buttons connected to GPIO 25 and 26 ( = DAC 1, = DAC2), using internal pullup resistors and declared interrupts on falling edge.
When I read the voltage (analogRead(_VBAT)) it fires the ISR method of these two buttons, but not others (GPIO 32, 33, 00).
I suspect DAC to be "activated" when reading _VBAT, also I tried :
1/ to disable DAC :
Code: Select all
dac_output_disable(DAC_CHANNEL_1);
dac_output_disable(DAC_CHANNEL_2);
dac_i2s_disable();
Code: Select all
noInterrupts();
int measure = analogRead(_VBAT);
delay(100);
interrupts();
Could someone help me ?
Am I wrong with the method to read voltage ?
Regards