Closed eren-rudy closed 1 year ago
Was able to implement easily using this convenient arduino-timer library.
I just realized that this is useless because it relies on the microprocessor running (calling timer.tick()
continuous is necessary for the timer to work...)
I've also tried using a hardware timer library (TimerInterrupt_Generic), which utilizes the Timer/Counter (TC) peripheral on the SAM-D21 chip.
However, after trying all of the selectable timer instances, it seems that their clock source by default turns off when the chip is in standby. In principle, there is apparently a workaround for this:
Source: SAM_D1 Datasheet
However, I am slightly concerned about the ease of implementing this in practice, particularly the interrupt configurations (since the Arduino Low Power library doesn't have an interface for setting 'internal' interrupt sources...).
Next promising avenue might be the RTCZero Library, which -- after running the examples -- thankfully seems to support the Feather M0.
Was able to get this working. See MWE_EventTimeoutWithInternalRTC
When a pseudo-continuous data source (rainfall sensor) stops triggering for some amount of time, log data (in this case can just do Serial for demonstration purposes).