Add ability to read alarm times

This commit is contained in:
2020-05-17 20:07:13 +02:00
parent a83671bda5
commit 966af1d5cf
2 changed files with 7 additions and 1 deletions

View File

@@ -173,6 +173,12 @@ int main()
if (receivedByte == 's') { if (receivedByte == 's') {
const auto newDate = receiveTime(); const auto newDate = receiveTime();
ds3231.setDateTime(newDate); ds3231.setDateTime(newDate);
} else if (receivedByte == '1') {
const auto alarm = ds3231.getAlarm1();
serial << F("Alarm1: ") << alarm << F("\r\n");
} else if (receivedByte == '2') {
const auto alarm = ds3231.getAlarm2();
serial << F("Alarm2: ") << alarm << F("\r\n");
} else } else
serial << F("Invalid input: ") << static_cast<char>(receivedByte) << F("\r\n"); serial << F("Invalid input: ") << static_cast<char>(receivedByte) << F("\r\n");
} }