Tutorial: How and Why to use Timers instead of the Delay() Function

The Arduino Maker Man
The Arduino Maker Man
17.8 هزار بار بازدید - 52 دقیقه پیش - A common problems with Arduino
A common problems with Arduino projects is that buttons or other input input sensors seem to be working intermittently or with a postponed reaction. In cases like this your project might be suffering from delays. From the beginning we get taught to use the delay() function if we want to create timed delays on execution of specific parts of our Arduino sketch. The drawback is that your loop gets halted and functions above and below the delay() are not being executed during this interval. A timer approach is a little harder to implement but will allow your main loop to keep executing and only exclude the code and functions you want to exclude. To simplify this we can use timer libraries like the elapsedMillis. For a more delailed explenation follow this link: www.thearduinomakerman.info/blog/2016/4/8/tutorial…
52 دقیقه پیش در تاریخ 1403/07/17 منتشر شده است.
17,834 بـار بازدید شده
... بیشتر