-
Notifications
You must be signed in to change notification settings - Fork 214
Open
Description
I tried to use TimerOne to delay for a period of 5 seconds and it did not work. Code below:
#include <TimerOne.h>
bool wait;
void setup() {
wait = 1;
Timer1.initialize(0);
Serial.begin(9600);
while( ! Serial )
;
}
void timerExpired() {
wait = 0;
}
void loop() {
Timer1.attachInterrupt(timerExpired, 1000000 * 5);
Timer1.start();
Serial.println("Waiting...");
while( wait )
;
Timer1.detachInterrupt();
wait = 0;
Serial.println("Timer expired.");
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels