-
-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
hi,
TimerLib.clearTimer();
no longer works in 1.6.5. I have tried it with the below 2 sample programs. The test devices are ESP32.
clearTimer() works on version 1.6.4.
I have tried with both setInterval and setTimeout.
Example 1 (setInterval)
#include "Arduino.h"
#include "uTimerLib.h"
volatile unsigned long int prevMillis = 0;
volatile unsigned long int actMillis = 0;
void timed_function() {
Serial.println(actMillis - prevMillis);
prevMillis = actMillis;
TimerLib.clearTimer();
}
void setup() {
Serial.begin(115200);
Serial.println("Timer started!");
TimerLib.setInterval_s(timed_function, 2);
prevMillis = millis();
}
void loop() {
actMillis = millis();
}
Example 2 (setTimeout)
#include "Arduino.h"
#include "uTimerLib.h"
volatile unsigned long int prevMillis = 0;
volatile unsigned long int actMillis = 0;
void timed_function() {
Serial.println(actMillis - prevMillis);
TimerLib.clearTimer();
}
void setup() {
Serial.begin(115200);
Serial.println("Timer started!");
TimerLib.setTimeout_s(timed_function, 2);
prevMillis = millis();
}
void loop() {
actMillis = millis();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels