The title says it all. I wanted to use Time Interrupts but the project I'm working on has almost no time for error, so I figured I would use Timelarms since they've been proven to work. But after taking a glance at the readme (because I'm using a timer elsewhere in my project and I wanted to check if they interrupted each other), it says that they don't use interrupts? Then how do they interrupt execution to execute a function?
Can you post a link?
Which board are you using?
My bad-- I didn't think someone would respond so fast.
Time Alarms Github: GitHub - PaulStoffregen/TimeAlarms: Time library add-on, schedule alarms to occur at specific dates/times
I'm using an Arduino Uno
@jediweirdo
Alarm.delay() keeps track of time and schedules the events.
You must call this function in loop()
Ahhhh... that makes sense. Kind of weird they chose to put that functionality in the delay method instead of its own aptly-named method like update or tick or something. Thanks!
I agree and he seem to skirt around the issue that you need to call that function or it won't work.
You can call Alarm.delay(0)
if you don't need an actual delay but just want to check the alarms and service them as necessary.
There is a function called serviceAlarms
that actually does the work inside the delay
function.
It is in the private:
section of the class declaration as standard, but I have moved it into the public:
part in my customised version of TimeAlarms so I could call it directly. Works perfectly.