Here is the code from one of the libraries examples that I’m using:
It’s basically just setting a time to wake up at using ’ rtc.setAlarmTime(17, 00, 10);’ then using ‘rtc.standbyMode();’ to put the sensor to sleep until the time passes that the alarm was set for.
I haven’t found any other ways to put the tag to sleep, but would love some tips on how this might be done. I’m guessing there might be some registers or something that could be directly set for a simple low power mode which I then turn off to wake the tag back up. I’m just not sure where to look to figure out what I need to set.
Sleep RTC Alarm for Arduino Zero
Demonstrates the use an alarm to wake up an Arduino zero from Standby mode
This example code is in the public domain
created by Arturo Guadalupi
17 Nov 2015
01 Mar 2016
If you use this sketch with a MKR1000 you will see no output on the serial monitor.
This happens because the USB clock is stopped so it the USB connection is stopped too.
**To see again the USB port you have to double tap on the reset button!**
/* Create an rtc object */
/* 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;
rtc.setTime(hours, minutes, seconds);
rtc.setDate(day, month, year);
rtc.setAlarmTime(17, 00, 10);
rtc.standbyMode(); // Sleep until next alarm match