Skip to content

Commit 07cd2aa

Browse files
V1.5.23 - Updates
- Added up time display to INFO menu
1 parent 8f049b0 commit 07cd2aa

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

Software/Arduino code/OpenAstroTracker/OpenAstroTracker.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
=======================================================================================================================================
1616
*/
17-
String version = "V1.5.22";
17+
String version = "V1.5.23";
1818

1919
boolean north = true; // change this to 'false' if youre in the southern hemisphere
2020

Software/Arduino code/OpenAstroTracker/b2_daytime.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ class DayTime {
2525
secs = s;
2626
}
2727

28+
// From milliseconds. Does not handle days!
29+
DayTime(long ms) {
30+
ms /= 1000; // seconds
31+
secs = (int)(ms % 60);
32+
ms = (ms - secs) / 60;
33+
mins = (int)(ms % 60);
34+
ms = (ms - mins) / 60;
35+
hours = (int)(ms % 24);
36+
}
37+
2838
int getHours() {
2939
return hours;
3040
}

Software/Arduino code/OpenAstroTracker/c78_menuINFO.ino

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
byte infoIndex = 0;
2-
byte maxInfoIndex = 3;
2+
byte maxInfoIndex = 4;
33
byte stepVsTime = 0;
44

55
void processStatusKeys(int key) {
@@ -60,6 +60,16 @@ void printStatusSubmenu() {
6060
}
6161
break;
6262
case 3: {
63+
long now=millis();
64+
long msPerDay = 60L * 60 * 24 * 1000;
65+
int days = (int)(now / msPerDay);
66+
now -= days * msPerDay;
67+
DayTime elapsed(now);
68+
sprintf(scratchBuffer,"Up: %dd %02d:%02d:%02d",days,elapsed.getHours(),elapsed.getMinutes(),elapsed.getSeconds());
69+
lcdMenu.printMenu(scratchBuffer);
70+
}
71+
break;
72+
case 4: {
6373
lcdMenu.printMenu("Firmw.: " + version);
6474
}
6575
break;

0 commit comments

Comments
 (0)