Compare commits

..

No commits in common. "drawBat" and "master" have entirely different histories.

1 changed files with 2 additions and 17 deletions

View File

@ -74,7 +74,6 @@ RTC_DATA_ATTR int timeDigits[4] = { 9, 5, 0, 0 }; // start time: 23:59
RTC_DATA_ATTR char calName[5][31];
RTC_DATA_ATTR char calStart[5][26];
RTC_DATA_ATTR char calTitle[5][81];
RTC_DATA_ATTR double voltage;
Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate library and also set library into 1 Bit mode
Network network; //Our networking functions, see Network.cpp for info
@ -84,7 +83,6 @@ void drawTime();
void drawCal();
void drawCalLine1(int entry);
void drawCalLine2(int entry);
void drawBat();
void setup() {
bool networking = false;
@ -97,14 +95,11 @@ void setup() {
//restore old bitmap (before the deep sleep)
drawTime();
drawCal();
drawBat();
display.load1b();
//Update data
if ((timeDigits[1] == 5) && (timeDigits[0] == 9)) { // every hour read the battery voltage and set the time from internet
adc_power_on();
voltage = display.readBattery();
network.begin();
if ((timeDigits[1] == 5) && (timeDigits[0] == 9)) {
network.begin(); // every hour set the time from internet
network.off();
networking = true;
}
@ -114,7 +109,6 @@ void setup() {
display.clearDisplay();
drawTime();
drawCal();
drawBat();
//Actually display all data
if (timeDigits[0]+timeDigits[1] == 0 || networking) {
@ -221,12 +215,3 @@ void drawCalLine2(int entry)
display.setTextWrap(false);
display.print(calTitle[entry]);
}
void drawBat()
{
display.setFont(NULL);
display.setTextSize(2);
display.setCursor(275, 10);
display.print(voltage);
display.print("V");
}