Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - ZWO AM5 Buzzer setup #2087

Merged
merged 4 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading