Skip to content

Commit 2942a04

Browse files
V1.4.5 - Updates
- - - Added a mode to troubleshoot LCD Shield key states. - Moved all the code inside the main loop() function into one file (c_button.ino) and deleted d_calculations and e_printout
1 parent f883690 commit 2942a04

File tree

5 files changed

+82
-45
lines changed

5 files changed

+82
-45
lines changed

Software/Arduino code/OpenAstroTracker/OpenAstroTracker.ino

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

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

@@ -58,3 +58,6 @@ int s = 25;
5858

5959
// Uncomment this to support the heating menu
6060
//#define SUPPORT_HEATING
61+
62+
// Uncomment to run a key diagnostic
63+
// #define LCD_BUTTON_TEST

Software/Arduino code/OpenAstroTracker/c5_calcStepperPos.ino

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,21 @@ void runTracker()
5656
stepperTRK.runSpeed();
5757
}
5858
}
59+
60+
void doCalculations() {
61+
currentSecs = millis() / 1000;
62+
63+
RADisplayTime.set(RATime);
64+
DayTime HACorrection(HATime);
65+
HACorrection.addTime(-h, -m, -s);
66+
RADisplayTime.addTime(HACorrection);
67+
68+
if (!north) {
69+
printdegDEC = degreeDEC - 90;
70+
if (printdegDEC < -90) degreeDEC = 0;
71+
}
72+
else {
73+
printdegDEC = degreeDEC + 90;
74+
if (printdegDEC > 90) degreeDEC = 0;
75+
}
76+
}

Software/Arduino code/OpenAstroTracker/c_buttons.ino

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
void loop() {
2+
#ifdef LCD_BUTTON_TEST
3+
4+
lcdMenu.setCursor(0, 0);
5+
lcdMenu.printMenu("Key Diagnostic");
6+
lcd_key = read_LCD_buttons();
7+
8+
lcdMenu.setCursor(0, 1);
9+
char buf[128];
10+
sprintf(buf, "ADC:%4d >", adc_key_in);
11+
String state = String(buf);
12+
switch (lcd_key )
13+
{
14+
case btnNONE: state += "None"; break;
15+
case btnSELECT: state += "Select"; break;
16+
case btnLEFT: state += "Left"; break;
17+
case btnRIGHT: state += "Right"; break;
18+
case btnUP: state += "Up"; break;
19+
case btnDOWN: state += "Down"; break;
20+
}
21+
lcdMenu.printMenu(state);
22+
23+
return;
24+
25+
#endif
26+
27+
228

329
lcd_key = read_LCD_buttons();
430

@@ -54,3 +80,37 @@ void loop() {
5480
}
5581

5682
runTracker();
83+
doCalculations();
84+
85+
if (!pcControl) {
86+
87+
lcd.setCursor(0, 0);
88+
89+
if (inStartup) {
90+
prinStartupMenu();
91+
}
92+
else {
93+
switch (lcdMenu.getActive()) {
94+
case RA_Menu: printRASubmenu(); break;
95+
case DEC_Menu: printDECSubmenu(); break;
96+
case POI_Menu: printPOISubmenu(); break;
97+
case HA_Menu: printHASubmenu(); break;
98+
case Home_Menu: printHomeSubmenu(); break;
99+
case Polaris_Menu: printPolarisSubmenu(); break;
100+
case Heat_Menu: printHeatSubmenu(); break;
101+
case Control_Menu: printControlSubmenu(); break;
102+
case Calibration_Menu: printCalibrationSubmenu(); break;
103+
}
104+
}
105+
106+
//tracking menu ----------------------
107+
/*if (lcdMenu.getActive() == TRK_Menu) {
108+
lcd.print("Tracking ON OFF");
109+
lcd.print(" ");
110+
}*/
111+
} else {
112+
moveSteppersToTargetAsync();
113+
}
114+
115+
BTin();
116+
}

Software/Arduino code/OpenAstroTracker/d_calculations.ino

Lines changed: 0 additions & 16 deletions
This file was deleted.

Software/Arduino code/OpenAstroTracker/e_printout.ino

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)