Xinyuan-LilyGO / LilyGo-EPD-4-7-OWM-Weather-Display

Using the LilyGo EPD 4.7" display to show OWM Weather Data
68 stars 28 forks source link

PIN 36 not ADC PIN #6

Open helios78 opened 7 months ago

helios78 commented 7 months ago

Model: 4.7-S3 , V2.3

[ 16458][E][esp32-hal-adc.c:158] __analogRead(): Pin 36 is not ADC pin!

This comes on serial when it tries to read the battery voltage

The board would only work when connected and powered by USB-C from computer

It will not work via battery or USB-C via charger

StaRipper commented 6 months ago

Same here.

I saw https://github.com/Xinyuan-LilyGO/LilyGo-EPD-4-7-OWM-Weather-Display/issues/4#issuecomment-1693043860 and https://github.com/esphome/feature-requests/issues/1960#issuecomment-1499559255 and https://github.com/kaeltis/esphome-lilygo-t547plus/blob/main/components/lilygo_t5_47_battery/Lilygot547Battery.cpp

The parameters are :

if CONFIG_IDF_TARGET_ESP32

const uint8_t bat_adc_pin = 36;

else

const uint8_t bat_adc_pin = 14;

endiff

float voltage = analogRead(bat_adc_pin) / 4096.0 * 6.566 * (vref / 1000.0);

I changed it to ...

if CONFIG_IDF_TARGET_ESP32

const uint8_t bat_adc_pin = 14;  

else

const uint8_t bat_adc_pin = 14;

endif

float voltage = analogRead(bat_adc_pin) / 4096.0 * 6.566 * (vref / 1000.0);

Did not solve the problem.