# Arduino Code for Project

**URL:** <https://forum.arduino.cc/t/arduino-code-for-project/1187707>\
**Category:** Programming\
**Created:** [November 10, 2023, 7:26pm UTC](https://forum.arduino.cc/t/arduino-code-for-project/1187707 "2023-11-10T19:26:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [November 10, 2023, 7:45pm UTC](https://forum.arduino.cc/t/arduino-code-for-project/1187707/3 "2023-11-10T19:45:19Z")

</div>

- Do not use delay(...) in your sketches.  
delay(...) stops/blocks all code execution during the delay period.

- When you want a TIMER, use the millis( ) function as mentioned here:

> [@Using millis() for timing. A beginners guide](https://forum.arduino.cc/t/using-millis-for-timing-a-beginners-guide/483573):
>
> Part 1 It is not usually long before new Arduino users discover that although the delay() function is easy to use it has side effects, the main one of which is that its stops all activity on the Arduino until the delay is finished (not quite true, I know, but that is usually how the problem presents itself). When this occurs the new user is usually directed to the BlinkWithoutDelay example sketch (BWoD) and/or the excellent thread entitled Several things at the same time. [Several things at the…](http://forum.arduino.cc/index.php?topic=223286.0)

* * *

* * *

- Also, do not acted on switch levels, instead use changes in switch state.

- Avoid using while( ) as it can block code execution.

---

_[View the full topic](https://forum.arduino.cc/t/arduino-code-for-project/1187707)._
