Skip to content

Commit

Permalink
Save the battery code put in place
Browse files Browse the repository at this point in the history
  • Loading branch information
tonym128 committed Jan 16, 2020
1 parent 062a53f commit 6c2b2b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ void gameLoop()
}

drawString(gameBuff,(char*)"LOW BATTERY!",0,0,0xE0,0);
drawString(gameBuff,(char*)"PLEASE CHARGE!",0,0,0xE0,0);

drawString(gameBuff,(char*)"PLEASE CHARGE!",0,16,0xE0,0);
return;
}

calcFPS();
Expand Down
2 changes: 1 addition & 1 deletion platform/esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static float battery_voltage = 0.0f;
static uint64_t timeStamp = 0;

float getVoltage() {
if (millis() - timeStamp > 10000) {
if (millis() - timeStamp > 2000) {
float v = ((float)analogRead(ADC_PIN) / 4095.0) * 2.0 * 3.3 * (vref / 1000.0);
if (v > 0) {
battery_voltage = v;
Expand Down

0 comments on commit 6c2b2b6

Please sign in to comment.