From d2d4ea4d08ed3679482ee91d003466cab1d3b286 Mon Sep 17 00:00:00 2001 From: Clayton Rogers Date: Sat, 31 Jul 2021 18:47:13 -0400 Subject: [PATCH 1/4] Change to more accurate ADC call --- src/Watchy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Watchy.cpp b/src/Watchy.cpp index 032df37..cc7e412 100644 --- a/src/Watchy.cpp +++ b/src/Watchy.cpp @@ -648,7 +648,8 @@ weatherData Watchy::getWeatherData(){ } float Watchy::getBatteryVoltage(){ - return analogRead(ADC_PIN) / 4096.0 * 7.23; + // Battery voltage goes through a 1/2 divider. + return analogReadMilliVolts(ADC_PIN) / 1000.0f * 2.0f; } uint16_t Watchy::_readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len) From 20ee700d5a308c29f8038836d54be96c965dfd22 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Sat, 21 Aug 2021 16:46:51 -0700 Subject: [PATCH 2/4] Added variable HOUR_12_24 to config.h, for setting a 12-hour or 24-hour time display. Set to 24 by default. --- examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp | 4 ++-- src/config.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp b/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp index 8929023..fc7ee73 100644 --- a/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp +++ b/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp @@ -27,10 +27,10 @@ void Watchy7SEG::drawWatchFace(){ void Watchy7SEG::drawTime(){ display.setFont(&DSEG7_Classic_Bold_53); display.setCursor(5, 53+5); - if(currentTime.Hour < 10){ + if(currentTime.Hour % HOUR_12_24 < 10){ display.print("0"); } - display.print(currentTime.Hour); + display.print(currentTime.Hour % HOUR_12_24); display.print(":"); if(currentTime.Minute < 10){ display.print("0"); diff --git a/src/config.h b/src/config.h index 28112d2..757c90e 100644 --- a/src/config.h +++ b/src/config.h @@ -48,6 +48,7 @@ #define SET_MONTH 3 #define SET_DAY 4 #define YEAR_OFFSET 1970 +#define HOUR_12_24 24 //BLE OTA #define BLE_DEVICE_NAME "Watchy BLE OTA" #define WATCHFACE_NAME "Watchy 7 Segment" @@ -57,4 +58,4 @@ #define HARDWARE_VERSION_MAJOR 1 #define HARDWARE_VERSION_MINOR 0 -#endif \ No newline at end of file +#endif From d9882ab63459f0c805c9c922d642175420812d80 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Sun, 22 Aug 2021 11:41:47 -0700 Subject: [PATCH 3/4] fixed incorrect 12h time conversion --- examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp b/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp index fc7ee73..7389f14 100644 --- a/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp +++ b/examples/WatchFaces/7_SEG/Watchy_7_SEG.cpp @@ -27,10 +27,16 @@ void Watchy7SEG::drawWatchFace(){ void Watchy7SEG::drawTime(){ display.setFont(&DSEG7_Classic_Bold_53); display.setCursor(5, 53+5); - if(currentTime.Hour % HOUR_12_24 < 10){ + int displayHour; + if(HOUR_12_24==12){ + displayHour = ((currentTime.Hour+11)%12)+1; + } else { + displayHour = currentTime.Hour; + } + if(displayHour < 10){ display.print("0"); } - display.print(currentTime.Hour % HOUR_12_24); + display.print(displayHour); display.print(":"); if(currentTime.Minute < 10){ display.print("0"); From 47976fa3de51ccb755ceb47b34064d60907f4a78 Mon Sep 17 00:00:00 2001 From: sqfmi Date: Sat, 30 Oct 2021 12:53:07 -0400 Subject: [PATCH 4/4] update to v1.2.7 --- library.json | 2 +- library.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index a1ff938..d56ce5e 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Watchy", - "version": "1.2.6", + "version": "1.2.7", "description": "Watchy - An Open Source E-Paper Watch by SQFMI", "authors": [ { diff --git a/library.properties b/library.properties index 0fa17f6..a17a113 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Watchy -version=1.2.6 +version=1.2.7 author=SQFMI maintainer=SQFMI sentence=Watchy - An Open Source E-Paper Watch by SQFMI