I am having a little trouble with my arduino deep sleep script. I want to create measuring station, which will get some value and after getting this value, after that will go sleep, for 5 minutes. I have been experimenting with this code and library, but I can not solve one problem. If I put in the setup Serial.print it is not working (the same thing is happening in the function alarmMatch().
Thank you much for your answers.
#include <RTCZero.h>
/* Create an rtc object */
RTCZero rtc;
/* Change these values to set the current initial time */
const byte seconds = 0;
const byte minutes = 00;
const byte hours = 17;
/* Change these values to set the current initial date */
const byte day = 17;
const byte month = 11;
const byte year = 15;
void setup()
{
delay(10000);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
Serial.begin(9600);
Serial.println("test");
rtc.begin();
Serial.println("test");
rtc.setTime(hours, minutes, seconds);
Serial.println("test");
rtc.setDate(day, month, year);
Serial.println("test");
rtc.setAlarmTime(17, 00, 10);
Serial.println("test");
rtc.enableAlarm(rtc.MATCH_HHMMSS);
Serial.println("test");
rtc.attachInterrupt(alarmMatch);
Serial.println("test");
rtc.standbyMode();
}
void loop()
{
// Sleep until next alarm match
}
void alarmMatch()
{
digitalWrite(LED_BUILTIN, HIGH);
}