J-M-L:
Indeed - The documentation explains the capability - so you need to play with what’s availableSet alarm at **:10 and when you get woken up change the next wake time to be at **:20 and then at **:40 and cycle back to :10
A start for this I found here: Alarm RTC DS3231 wake Arduino? - Programming Questions - Arduino Forum
But he uses DS3231RTC library while I need to use RTClibExtended.h so either I have to find the similarities by perusing both libraries or someone here already has some code for it.
The solution using the first library would be (wake up every 20 minutes):
#include <DS3232RTC.h>
#include <Wire.h>
DS3232RTC rtc;
void setup()
{
Serial.begin( 115200 );
Wire.begin();
rtc.alarm( ALARM_1 ); // makes sure A1F is cleared (see datasheet p.14)
rtc.setAlarm( ALM1_MATCH_SECONDS, 0, 0, 0, 0 );
}
void loop()
{
if ( rtc.alarm( ALARM_1 ) )
{
tmElements_t tm;
rtc.read( tm );
RTC.setAlarm(ALM1_MATCH_MINUTES, 0, (tm.Minute + 20) % 60, 0, 0);
time_t now = makeTime( tm );
Serial.println( now );
}
}
..but tmElements_t tm; and rtc.read(tm); are not used in the second (RTClibExtended.h) library.