Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <DS3231_Simple.h>
- DS3231_Simple Clock;
- DateTime MyTimestamp;
- void setup() {
- Serial.begin(9600);
- Serial.println();
- Clock.begin();
- Clock.disableAlarms();
- MyTimestamp = Clock.read();
- MyTimestamp.Hour= 10; //Version die funktioniert
- MyTimestamp.Minute = 37;
- //MyTimestamp.Second=1; Version Funktioniert
- Clock.setAlarm(MyTimestamp, DS3231_Simple::ALARM_MATCH_MINUTE_HOUR);
- //Clock.setAlarm(MyTimestamp, DS3231_Simple::ALARM_MATCH_SECOND); Version nur mit Sekunden
- Serial.println("Waiting for alarms...");
- }
- void loop()
- {
- MyTimestamp.Hour = 10; //Version die nicht funktioniert
- MyTimestamp.Minute =37;
- // MyTimestamp.Second = 1; Version funktioniert ebenfalls
- uint8_t AlarmsFired = Clock.checkAlarms();
- if(AlarmsFired &2)
- {
- Clock.printTo(Serial);Serial.println(": Alarm has fired!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement