Hello, as the title requests - this is my code:
uint16_t intervalId = Timer.setInterval([intervalId]() {
Serial.println("123");
if (true) {
Timer.cancel(intervalId);
}
}, 1000);
It's sometimes very clean to cancel an interval from within itself based on control logic. Is there a way of doing this without Timer.cancelAll() (which does work for now)?
Thank you,
This is a great library by the way, it's resolved all blocking issues and is clean to use.