# Setting variable and overriding for a timer in arduino

**URL:** <https://forum.arduino.cc/t/setting-variable-and-overriding-for-a-timer-in-arduino/1224807>\
**Category:** Programming\
**Created:** [February 16, 2024, 6:55pm UTC](https://forum.arduino.cc/t/setting-variable-and-overriding-for-a-timer-in-arduino/1224807 "2024-02-16T18:55:11Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [February 16, 2024, 6:58pm UTC](https://forum.arduino.cc/t/setting-variable-and-overriding-for-a-timer-in-arduino/1224807/3 "2024-02-16T18:58:56Z")

</div>

> [@bpall](#):
>
> ```arduino
> while(timer<=5000){
> digitalWrite(led,HIGH);
>     
> }
> 
> ```

how do you think timer will change its value ?

study

- [Using millis() for timing. A beginners guide](https://forum.arduino.cc/index.php?topic=503368.0)
- [Several things at the same time](https://forum.arduino.cc/index.php?topic=223286.0)
- [Flashing multiple LEDs at the same time](https://forum.arduino.cc/t/flashing-multiple-leds-at-the-same-time/1065564)

you might also benefit from studying state machines. Here is a small introduction to the topic: [Yet another Finite State Machine introduction](https://forum.arduino.cc/t/yet-another-finite-state-machine-introduction/1198997)

---

_[View the full topic](https://forum.arduino.cc/t/setting-variable-and-overriding-for-a-timer-in-arduino/1224807)._
