Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIN 36 not ADC PIN #6

Open
helios78 opened this issue Mar 27, 2024 · 1 comment
Open

PIN 36 not ADC PIN #6

helios78 opened this issue Mar 27, 2024 · 1 comment

Comments

@helios78
Copy link

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
Copy link

Same here.

I saw #4 (comment) and esphome/feature-requests#1960 (comment) 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants