/* Blink_lp_timer_GT832E_01 Turns on an 'led' on/off at 10Hz (c)2022 Forward Computing and Control Pty. Ltd. This example code is in the public domain. */ #include int led = 4; // Use D4 (P0.29) has the 'led' pin bool ledOn = false; lp_timer ledTimer; const unsigned long DELAY_TIME = 50; // ms == 10Hz // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); ledTimer.startTimer(DELAY_TIME, handleLedTimer); } void loop() { sleep(); // just sleep here waiting for the timer to trigger } void handleLedTimer() { ledOn = !ledOn; // toggle state if (ledOn) { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) } else { digitalWrite(led, LOW); // turn the LED off by making the voltage LOW } }