t-deck Battery Indicator
im working on battery indicator for t-deck for a project im working on , any help
teastain2 last edited by teastain2
@abdnatsheh I don't have a T-Deck, but this works on my LilyGO T-Display S3
Add these lines:
#define BAT_ADC_PIN 4 and the the loop: uint32_t voltage = readAdcVoltage(BAT_ADC_PIN) * 2; tft.setCursor(50, 70, 4); //add correct offsets as required for your board tft.setTextColor(TFT_RED); tft.fillRect(42, 70, 70, 25, TFT_BLACK);//add correct offsets as required tft.print(((float)voltage/1000) +0.32);
The ESP32 has a notoriously bad ADC with linearity and offset issues, so this reading cannot be used for scientific observations, only a relative health check.
Also when the USB is hooked up the Battery charge voltage is 5V !!!
You can only see the battery when USB is unplugged.
Hope this helps
thanks for your reply !