my battery is lifepo4 3.32v currently. then i set
adc1_config_width(ADC_WIDTH_11Bit);
adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_DB_11);
//set reference voltage
So if i applied 3.9v then i will se 2047 in monitor.
Code for measyre adc value
for (int i = 0; i < 500; i++)
{
sum += adc1_get_voltage(ADC1_CHANNEL_0);
delayMicroseconds(1000);
}
// calculate the voltage
voltage = sum / (float)500;
But when i apply lifepo4 (3.2v) to GPIO36, i always see 2047? where is the problem?