@@ -373,15 +373,15 @@ void Mount::setLST(const DayTime& lst) {
373373// setLatitude
374374//
375375// ///////////////////////////////
376- void Mount::setLatitude (float lat) {
376+ void Mount::setLatitude (float lat) {
377377 _latitude = lat;
378378}
379379// ///////////////////////////////
380380//
381381// setLongitude
382382//
383383// ///////////////////////////////
384- void Mount::setLongitude (float lon) {
384+ void Mount::setLongitude (float lon) {
385385 _longitude = lon;
386386}
387387
@@ -391,7 +391,7 @@ void Mount::setLongitude(float lon) {
391391//
392392// ///////////////////////////////
393393const float Mount::latitude () const {
394- return _latitude ;
394+ return _latitude;
395395}
396396// ///////////////////////////////
397397//
@@ -443,8 +443,8 @@ const DayTime Mount::currentRA() const {
443443 logv (" CurrentRA: POS (+zp) : %s" , DayTime (hourPos).ToString ());
444444#endif
445445
446- bool flipRA = NORTHERN_HEMISPHERE ?
447- _stepperDEC->currentPosition () < 0
446+ bool flipRA = NORTHERN_HEMISPHERE ?
447+ _stepperDEC->currentPosition () < 0
448448 : _stepperDEC->currentPosition () > 0 ;
449449 if (flipRA)
450450 {
@@ -948,20 +948,21 @@ void Mount::startSlewing(int direction) {
948948 _mountStatus |= STATUS_TRACKING;
949949 }
950950 else {
951+ int sign = NORTHERN_HEMISPHERE ? 1 : -1 ;
951952 if (direction & NORTH) {
952- _stepperDEC->moveTo (30000 );
953+ _stepperDEC->moveTo (sign * 30000 );
953954 _mountStatus |= STATUS_SLEWING;
954955 }
955956 if (direction & SOUTH) {
956- _stepperDEC->moveTo (-30000 );
957+ _stepperDEC->moveTo (-sign * 30000 );
957958 _mountStatus |= STATUS_SLEWING;
958959 }
959960 if (direction & EAST) {
960- _stepperRA->moveTo (-30000 );
961+ _stepperRA->moveTo (-sign * 30000 );
961962 _mountStatus |= STATUS_SLEWING;
962963 }
963964 if (direction & WEST) {
964- _stepperRA->moveTo (30000 );
965+ _stepperRA->moveTo (sign * 30000 );
965966 _mountStatus |= STATUS_SLEWING;
966967 }
967968 }
@@ -1049,7 +1050,7 @@ void Mount::loop() {
10491050 bool decStillRunning = false ;
10501051
10511052 unsigned long now = millis ();
1052- #ifdef DEBUG_MODE
1053+ #if defined DEBUG_MODE && defined SEND_PERIODIC_UPDATES
10531054 if (now - _lastMountPrint > 2000 ) {
10541055 Serial.println (getStatusString ());
10551056 _lastMountPrint = now;
@@ -1280,8 +1281,11 @@ void Mount::calculateRAandDECSteppers(float& targetRA, float& targetDEC) {
12801281#endif
12811282
12821283 float hourPos = raTarget.getTotalHours ();
1284+ if (!NORTHERN_HEMISPHERE) {
1285+ hourPos += 12 ;
1286+ }
12831287 // Map [0 to 24] range to [-12 to +12] range
1284- if (hourPos > 12 ) {
1288+ while (hourPos > 12 ) {
12851289 hourPos = hourPos - 24 ;
12861290#ifdef DEBUG_MODE
12871291 logv (" Mount::CalcSteppersIn: RA>12 so -24. New Target RA: %s, DEC: %s" , DayTime (hourPos).ToString (), _targetDEC.ToString ());
@@ -1460,7 +1464,7 @@ String Mount::DECString(byte type, byte active) {
14601464#ifdef DEBUG_MODE
14611465 logv (" DECString: TARGET!" );
14621466#endif
1463- dec = DegreeTime ( _targetDEC) ;
1467+ dec = _targetDEC;
14641468 }
14651469 else {
14661470#ifdef DEBUG_MODE
0 commit comments