Skip to content

Commit

Permalink
Merge pull request OpenAstroTech#111 from OpenAstroTech/build-fix
Browse files Browse the repository at this point in the history
Build fix
  • Loading branch information
ClutchplateDude authored Nov 3, 2020
2 parents 32ce649 + 8b52e8e commit ca17634
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Software/Arduino code/OpenAstroTracker/src/Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ void Mount::setSpeed(int which, float speedDegsPerSec) {
float curAzSpeed = _stepperAZ->speed();

// If we are changing directions or asking for a stop, do a stop
if ((signbit(speed) != signbit(curAzSpeed)) || (speed == 0))
if ((signbit(speedDegsPerSec) != signbit(curAzSpeed)) || (speedDegsPerSec == 0))
{
_stepperAZ->stop();
while (_stepperAZ->isRunning()){
Expand All @@ -1311,20 +1311,20 @@ void Mount::setSpeed(int which, float speedDegsPerSec) {
}

// Are we starting a move or changing speeds?
if (speed != 0) {
if (speedDegsPerSec != 0) {
_stepperAZ->enableOutputs();
_stepperAZ->setSpeed(speed);
_stepperAZ->move(speed * 100000);
_stepperAZ->setSpeed(speedDegsPerSec);
_stepperAZ->move(speedDegsPerSec * 100000);
} // Are we stopping a move?
else if (speed == 0) {
else if (speedDegsPerSec == 0) {
_stepperAZ->disableOutputs();
}
}
else if (which == ALTITUDE_STEPS) {
float curAltSpeed = _stepperALT->speed();

// If we are changing directions or asking for a stop, do a stop
if ((signbit(speed) != signbit(curAltSpeed)) || (speed == 0))
if ((signbit(speedDegsPerSec) != signbit(curAltSpeed)) || (speedDegsPerSec == 0))
{
_stepperALT->stop();
while (_stepperALT->isRunning()){
Expand All @@ -1333,12 +1333,12 @@ void Mount::setSpeed(int which, float speedDegsPerSec) {
}

// Are we starting a move or changing speeds?
if (speed != 0) {
if (speedDegsPerSec != 0) {
_stepperALT->enableOutputs();
_stepperALT->setSpeed(speed);
_stepperALT->move(speed * 100000);
_stepperALT->setSpeed(speedDegsPerSec);
_stepperALT->move(speedDegsPerSec * 100000);
} // Are we stopping a move?
else if (speed == 0) {
else if (speedDegsPerSec == 0) {
_stepperALT->disableOutputs();
}
}
Expand Down

0 comments on commit ca17634

Please sign in to comment.