ItimerStop() stops the default or specified callback timer.
void ItimerStop()
void ItimerStop(uint8_t timerNumber)
| Command | Arguments | Return Value | Operation |
|---|---|---|---|
ItimerStop() | None | void | Stops the default or specified callback timer. |
This uses the default callback timer (Timer2). The callback changes only a flag; serial output runs in loop().
void onTimer() {} void setup() { Serial.begin(115200); if (!ItimerSet(1000, onTimer)) return; // Configure the callback and interval first. ItimerStart(); // Start the configured callback timer. } void loop() { static bool stopped = false; if (!stopped && millis() >= 5000) { ItimerStop(); // Stop the default callback timer after 5 s. stopped = true; Serial.println(F("timer stopped")); } }
delay(), Serial, I2C or SPI in it.tone() or PWM output that uses Timer2.