Skip to content

Commit

Permalink
ZWO AM5 Save home position in the mount (#2093)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-soja authored Jul 29, 2024
1 parent 70722a0 commit 1d1a8ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/telescope/lx200am5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,16 @@ bool LX200AM5::goHome()
return sendCommand(":hC#");
}

/////////////////////////////////////////////////////////////////////////////
///
/////////////////////////////////////////////////////////////////////////////
bool LX200AM5::setHome()
{
const char cmd[] = ":SOa#";
char status ='0';
return sendCommand(cmd, &status, strlen(cmd), sizeof(status)) && status == '1';
}

/////////////////////////////////////////////////////////////////////////////
///
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -651,6 +661,12 @@ IPState LX200AM5::ExecuteHomeAction(TelescopeHomeAction action)
else
return IPS_ALERT;

case HOME_SET:
if (setHome())
return IPS_OK;
else
return IPS_ALERT;

default:
return IPS_ALERT;

Expand Down
1 change: 1 addition & 0 deletions drivers/telescope/lx200am5.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class LX200AM5 : public LX200Generic

// Homing
bool goHome();
bool setHome();

// Guide Rate
bool setGuideRate(double value);
Expand Down

0 comments on commit 1d1a8ae

Please sign in to comment.