You've already forked TEF6686_ESP32
Merge pull request #61 from ohmytime/Adjust-bat
Better way to show bat icon
This commit is contained in:
@@ -3979,11 +3979,10 @@ void ShowBattery() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t batteryadc = analogRead(BATTERY_PIN);
|
battery = map(constrain(analogRead(BATTERY_PIN), BAT_LEVEL_EMPTY, BAT_LEVEL_FULL), BAT_LEVEL_EMPTY, BAT_LEVEL_FULL, 0, BAT_LEVEL_STAGE);
|
||||||
battery = map(constrain(batteryadc, BAT_LEVEL_EMPTY, BAT_LEVEL_FULL), BAT_LEVEL_EMPTY, BAT_LEVEL_FULL, 0, BAT_LEVEL_STAGE);
|
|
||||||
if (batteryold != battery) {
|
if (batteryold != battery) {
|
||||||
if (batterydetect) {
|
if (batterydetect) {
|
||||||
if (batteryadc < BAT_LEVEL_WARN) {
|
if (battery == 0) {
|
||||||
tft.drawRect(300, 8, 12, 20, TFT_RED);
|
tft.drawRect(300, 8, 12, 20, TFT_RED);
|
||||||
tft.fillRect(303, 4, 6, 4, TFT_RED);
|
tft.fillRect(303, 4, 6, 4, TFT_RED);
|
||||||
tft.fillRect(302, 10, 8, 16, TFT_BLACK);
|
tft.fillRect(302, 10, 8, 16, TFT_BLACK);
|
||||||
|
|||||||
Reference in New Issue
Block a user