Skip to content

Commit 87fba58

Browse files
Merge pull request #97 from OpenAstroTech/guiding-fix
V1.8.39 - Updates
2 parents fbbfed8 + 31a3ef1 commit 87fba58

File tree

7 files changed

+180
-117
lines changed

7 files changed

+180
-117
lines changed

Software/Arduino code/OpenAstroTracker/Configuration_adv.hpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,22 +249,25 @@
249249
////////////////////////////
250250
// Debugging output control
251251
// Each bit in the debug level specifies a kind of debug to enable. Do not change.
252-
#define DEBUG_NONE 0x00
253-
#define DEBUG_INFO 0x01
254-
#define DEBUG_SERIAL 0x02
255-
#define DEBUG_WIFI 0x04
256-
#define DEBUG_MOUNT 0x08
257-
#define DEBUG_MOUNT_VERBOSE 0x10
258-
#define DEBUG_GENERAL 0x20
259-
#define DEBUG_MEADE 0x40
260-
#define DEBUG_VERBOSE 0x80
261-
#define DEBUG_ANY 0xFF
252+
#define DEBUG_NONE 0x0000
253+
#define DEBUG_INFO 0x0001
254+
#define DEBUG_SERIAL 0x0002
255+
#define DEBUG_WIFI 0x0004
256+
#define DEBUG_MOUNT 0x0008
257+
#define DEBUG_MOUNT_VERBOSE 0x0010
258+
#define DEBUG_GENERAL 0x0020
259+
#define DEBUG_MEADE 0x0040
260+
#define DEBUG_VERBOSE 0x0080
261+
#define DEBUG_STEPPERS 0x0100
262+
#define DEBUG_ANY 0xFFFF
262263

263264
////////////////////////////
264265
//
265266
// DEBUG OUTPUT
266267
//
267268
#define DEBUG_LEVEL (DEBUG_NONE)
269+
// #define DEBUG_LEVEL (DEBUG_STEPPERS|DEBUG_MOUNT)
270+
// #define DEBUG_LEVEL (DEBUG_INFO|DEBUG_MOUNT|DEBUG_GENERAL)
268271
// #define DEBUG_LEVEL (DEBUG_SERIAL|DEBUG_WIFI|DEBUG_INFO|DEBUG_MOUNT|DEBUG_GENERAL)
269272
// #define DEBUG_LEVEL (DEBUG_ANY)
270273
// #define DEBUG_LEVEL (DEBUG_INFO|DEBUG_MOUNT|DEBUG_GENERAL)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define VERSION "V1.8.38"
1+
#define VERSION "V1.8.39"

Software/Arduino code/OpenAstroTracker/src/Mount.cpp

Lines changed: 78 additions & 40 deletions
Large diffs are not rendered by default.

Software/Arduino code/OpenAstroTracker/src/Mount.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ class Mount {
353353
float _trackingSpeed;
354354
float _trackingSpeedCalibration;
355355
unsigned long _lastDisplayUpdate;
356+
unsigned long _trackerStoppedAt;
357+
bool _compensateForTrackerOff;
356358
volatile int _mountStatus;
357359
char scratchBuffer[24];
358360
bool _stepperWasRunning;

Software/Arduino code/OpenAstroTracker/src/Utility.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,17 @@ void logv(int levelFlags, String input, ...)
284284
{
285285
if ((levelFlags & DEBUG_LEVEL) != 0)
286286
{
287+
unsigned long now = millis();
287288
va_list argp;
288289
va_start(argp, input);
289290
#if BUFFER_LOGS
290291
addToLogBuffer(formatArg(input.c_str(), argp));
291292
#else
293+
Serial.print("[");
294+
Serial.print(String(now));
295+
Serial.print("]:");
292296
Serial.print(String(freeMemory()));
293-
Serial.print(":");
297+
Serial.print(": ");
294298
Serial.println(formatArg(input.c_str(), argp));
295299
Serial.flush();
296300
#endif

Software/Arduino code/OpenAstroTracker/src/b_setup.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void finishSetup()
227227
mount.configureDECStepper(HALFSTEP_MODE, DECmotorPin1, DECmotorPin2, DECmotorPin3, DECmotorPin4, RA_STEPPER_SPEED, DEC_STEPPER_ACCELERATION);
228228
#elif DEC_STEPPER_TYPE == STEPPER_TYPE_NEMA17
229229
LOGV1(DEBUG_ANY, F("Configure DEC stepper NEMA..."));
230-
mount.configureDECStepper(DRIVER_MODE, DECmotorPin1, DECmotorPin2, RA_STEPPER_SPEED, DEC_STEPPER_ACCELERATION);
230+
mount.configureDECStepper(DRIVER_MODE, DECmotorPin1, DECmotorPin2, DEC_STEPPER_SPEED, DEC_STEPPER_ACCELERATION);
231231
#else
232232
#error New stepper type? Configure it here.
233233
#endif

Software/Arduino code/OpenAstroTracker/src/c722_menuPOI.hpp

Lines changed: 80 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
#if HEADLESS_CLIENT == 0
44
#if SUPPORT_POINTS_OF_INTEREST == 1
5-
struct PointOfInterest {
6-
const char* pDisplay;
5+
struct PointOfInterest
6+
{
7+
const char *pDisplay;
78
byte hourRA;
89
byte minRA;
910
byte secRA;
@@ -14,89 +15,104 @@ struct PointOfInterest {
1415

1516
// Points of interest are sorted by DEC
1617
PointOfInterest pointOfInterest[] = {
17-
// Name (15chars) RA (hms) DEC (dms)
18-
// 012345678901234
19-
{ ">Polaris" , POLARIS_RA_HOUR, POLARIS_RA_MINUTE, POLARIS_RA_SECOND, 89, 21, 6 },
20-
{ ">Veil Nebula" ,20, 51, 28, 30, 59, 30 },
21-
{ ">M81 Bodes Galxy" , 9, 57, 13, 68, 58, 1 },
22-
{ ">Cederblad 214" , 0, 5, 46, 67, 16, 45 },
23-
{ ">Heart Nebula" , 2, 34, 57, 61, 31, 17 },
24-
{ ">Navi" , 0, 57, 57, 60, 49, 33 },
25-
{ ">Soul Nebula" , 2, 52, 47, 60, 30, 56 },
26-
{ ">Elephant Trunk" ,21, 39, 44, 57, 35, 31 },
27-
{ ">Big Dipper" ,12, 16, 26, 56, 55, 7 },
28-
{ ">M101 Pinwheel" ,14, 3, 56, 54, 15, 0 },
29-
{ ">M51 Whirlpool" ,13, 30, 45, 47, 5, 21 },
30-
{ ">Deneb (Cygnus)" ,20, 42, 7, 45, 21, 12 },
31-
{ ">M63 Sunflower" ,13, 16, 45, 41, 55, 14 },
32-
{ ">M31 Andromeda" , 0, 43, 52, 41, 22, 53 },
33-
{ ">Vega" ,18, 37, 37, 38, 48, 7 },
34-
{ ">Arcturus" ,14, 16, 37, 19, 5, 21 },
35-
{ ">Altair" ,19, 51, 45, 8, 55, 15 },
36-
{ ">M42 Orion Nbula" , 5, 36, 18, -5, 22, 44 },
37-
{ ">Lagoon Nebula" ,18, 5, 2, -24, 22, 52 },
18+
// Name (15chars) RA (hms) DEC (dms)
19+
//0123456789012345
20+
{">Polaris", POLARIS_RA_HOUR, POLARIS_RA_MINUTE, POLARIS_RA_SECOND, 89, 21, 6},
21+
{">Veil Nebula", 20, 51, 28, 30, 59, 30},
22+
{">M81 Bodes Galxy", 9, 57, 13, 68, 58, 1},
23+
{">Cederblad 214", 0, 5, 46, 67, 16, 45},
24+
{">Heart Nebula", 2, 34, 57, 61, 31, 17},
25+
{">Navi", 0, 57, 57, 60, 49, 33},
26+
{">Soul Nebula", 2, 52, 47, 60, 30, 56},
27+
{">Elephant Trunk", 21, 39, 44, 57, 35, 31},
28+
{">Big Dipper", 12, 16, 26, 56, 55, 7},
29+
{">M101 Pinwheel", 14, 3, 56, 54, 15, 0},
30+
{">M51 Whirlpool", 13, 30, 45, 47, 5, 21},
31+
{">Deneb (Cygnus)", 20, 42, 7, 45, 21, 12},
32+
{">M63 Sunflower", 13, 16, 45, 41, 55, 14},
33+
{">M31 Andromeda", 0, 43, 52, 41, 22, 53},
34+
{">Vega", 18, 37, 37, 38, 48, 7},
35+
{">M33 Triangulum", 1, 35, 02, 30, 46, 5},
36+
{">Pleiades 7Sistr", 3, 48, 15, 24, 10, 54},
37+
{">Arcturus", 14, 16, 37, 19, 5, 21},
38+
{">Altair", 19, 51, 45, 8, 55, 15},
39+
{">M42 Orion Nbula", 5, 36, 18, -5, 22, 44},
40+
{">Lagoon Nebula", 18, 5, 2, -24, 22, 52},
3841

39-
// Add new items above here, not below.
40-
{ ">Home" , 0, 0, 0, 90, 0, 0 },
41-
{ ">Unpark" , 0, 0, 0, 90, 0, 0 },
42-
{ ">Park" , 0, 0, 0, 90, 0, 0 },
43-
// And definitely don't add here.
42+
// Add new items above here, not below.
43+
{">Home", 0, 0, 0, 90, 0, 0},
44+
{">Unpark", 0, 0, 0, 90, 0, 0},
45+
{">Park", 0, 0, 0, 90, 0, 0},
46+
// And definitely don't add here.
4447
};
4548

4649
int currentPOI = 0;
4750
int parkPOI = sizeof(pointOfInterest) / sizeof(pointOfInterest[0]) - 1;
4851
int unparkPOI = sizeof(pointOfInterest) / sizeof(pointOfInterest[0]) - 2;
4952
byte homePOI = sizeof(pointOfInterest) / sizeof(pointOfInterest[0]) - 3;
5053

51-
bool processPOIKeys() {
54+
bool processPOIKeys()
55+
{
5256
byte key;
5357
bool waitForRelease = false;
54-
if (lcdButtons.keyChanged(&key)) {
58+
if (lcdButtons.keyChanged(&key))
59+
{
5560
waitForRelease = true;
56-
switch (key) {
57-
case btnSELECT: {
58-
mount.stopSlewing(ALL_DIRECTIONS);
59-
if (currentPOI == homePOI) {
60-
mount.goHome();
61-
}
62-
else if (currentPOI == parkPOI) {
63-
mount.park();
64-
}
65-
else if (currentPOI == unparkPOI) {
66-
mount.startSlewing(TRACKING);
67-
}
68-
else {
69-
PointOfInterest* poi = &pointOfInterest[currentPOI];
70-
mount.targetRA().set(poi->hourRA, poi->minRA, poi->secRA);
71-
mount.targetDEC().set(poi->degreeDEC - (NORTHERN_HEMISPHERE ? 90 : -90), poi->minDEC, poi->secDEC); // internal DEC degree is 0 at celestial poles
72-
mount.startSlewingToTarget();
73-
}
61+
switch (key)
62+
{
63+
case btnSELECT:
64+
{
65+
mount.stopSlewing(ALL_DIRECTIONS);
66+
if (currentPOI == homePOI)
67+
{
68+
mount.goHome();
7469
}
75-
break;
76-
77-
case btnLEFT:
78-
case btnDOWN: {
79-
currentPOI = adjustWrap(currentPOI, 1, 0, parkPOI);
70+
else if (currentPOI == parkPOI)
71+
{
72+
mount.park();
8073
}
81-
break;
82-
83-
case btnUP: {
84-
currentPOI = adjustWrap(currentPOI, -1, 0, parkPOI);
74+
else if (currentPOI == unparkPOI)
75+
{
76+
mount.startSlewing(TRACKING);
8577
}
86-
break;
87-
88-
case btnRIGHT: {
89-
lcdMenu.setNextActive();
78+
else
79+
{
80+
PointOfInterest *poi = &pointOfInterest[currentPOI];
81+
mount.targetRA().set(poi->hourRA, poi->minRA, poi->secRA);
82+
mount.targetDEC().set(poi->degreeDEC - (NORTHERN_HEMISPHERE ? 90 : -90), poi->minDEC, poi->secDEC); // internal DEC degree is 0 at celestial poles
83+
mount.startSlewingToTarget();
9084
}
91-
break;
85+
}
86+
break;
87+
88+
case btnLEFT:
89+
case btnDOWN:
90+
{
91+
currentPOI = adjustWrap(currentPOI, 1, 0, parkPOI);
92+
}
93+
break;
94+
95+
case btnUP:
96+
{
97+
currentPOI = adjustWrap(currentPOI, -1, 0, parkPOI);
98+
}
99+
break;
100+
101+
case btnRIGHT:
102+
{
103+
lcdMenu.setNextActive();
104+
}
105+
break;
92106
}
93107
}
94108

95109
return waitForRelease;
96110
}
97111

98-
void printPOISubmenu() {
99-
if (mount.isSlewingIdle()) {
112+
void printPOISubmenu()
113+
{
114+
if (mount.isSlewingIdle())
115+
{
100116
lcdMenu.printMenu(pointOfInterest[currentPOI].pDisplay);
101117
}
102118
}

0 commit comments

Comments
 (0)