Skip to content

Commit

Permalink
Feature - ZWO AM5 Buzzer setup (#2087)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-soja authored Jul 28, 2024
1 parent ad11753 commit 3fffb79
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@
</device>
<device label="ZWO AM5 WiFi" manufacturer="ZWO">
<driver name="ZWO AM5">indi_lx200am5</driver>
<version>1.1</version>
<version>1.2</version>
</device>
<device label="ZWO AM5 USB" manufacturer="ZWO">
<driver name="ZWO AM5">indi_lx200am5</driver>
<version>1.1</version>
<version>1.2</version>
</device>
<device label="Celestron GPS" manufacturer="Celestron">
<driver name="Celestron GPS">indi_celestron_gps</driver>
Expand Down
15 changes: 13 additions & 2 deletions drivers/telescope/lx200am5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

LX200AM5::LX200AM5()
{
setVersion(1, 1);
setVersion(1, 2);

setLX200Capability(LX200_HAS_PULSE_GUIDING);

Expand Down Expand Up @@ -106,6 +106,17 @@ bool LX200AM5::initProperties()
BuzzerSP[Low].fill("LOW", "Low", ISS_OFF);
BuzzerSP[High].fill("HIGH", "High", ISS_ON);
BuzzerSP.fill(getDeviceName(), "BUZZER", "Buzzer", OPTIONS_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
BuzzerSP.onUpdate([this]{
if (setBuzzer(BuzzerSP.findOnSwitchIndex()))
{
BuzzerSP.setState(IPState::IPS_OK);
}
else
{
BuzzerSP.setState(IPState::IPS_ALERT);
}
BuzzerSP.apply();
});

return true;
}
Expand Down Expand Up @@ -342,7 +353,7 @@ bool LX200AM5::getTrackMode()
bool LX200AM5::setBuzzer(int value)
{
char command[DRIVER_LEN] = {0};
snprintf(command, DRIVER_LEN, ":SBu%d", value);
snprintf(command, DRIVER_LEN, ":SBu%d#", value);
return sendCommand(command);
}

Expand Down

0 comments on commit 3fffb79

Please sign in to comment.