hello, when i make a sketch, i found on some code surround, the timer not working as expected: only execute one time, it should not happen but it does. i checked for many time but can't figure out why this happen. thank you for any suggestion.
here are my codes, i deleted the code does not relation. copy the all codes below, serial monitor, the problem will reproduce.
#include "arduino-timer.h"
auto timer = timer_create_default();
boolean verify_passed = false;
boolean led_receiving_data = false;
void setup() {
Serial.begin(115200);
timer.every(2000, toggle_led);
}
void loop() {
timer.tick();
if (verify_passed == false) {
} else {
led_receiving_data = true;
}
}
void toggle_led() {
Serial.print("a"); //<----------- only execute one time
if (led_receiving_data == true) {
Serial.print("b");
}
}