From d9882ab63459f0c805c9c922d642175420812d80 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Sun, 22 Aug 2021 11:41:47 -0700 Subject: [PATCH] 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");