# Timer0\_mills error

**URL:** <https://forum.arduino.cc/t/timer0-mills-error/1118362>\
**Category:** Programming\
**Created:** [April 22, 2023, 5:13pm UTC](https://forum.arduino.cc/t/timer0-mills-error/1118362 "2023-04-22T17:13:13Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![StefanL38](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefanl38/32/713548_2.png) [@StefanL38](https://forum.arduino.cc/u/StefanL38)\
**Post date:** [April 23, 2023, 7:09am UTC](https://forum.arduino.cc/t/timer0-mills-error/1118362/6 "2023-04-23T07:09:43Z")

</div>

Hi @say2k

indeed you should confirm or correct what @johnwasser was asking

> [@johnwasser](#):
>
> It looks like what you are doing is:
> 
> After 1 minute, move to -7000  
> After 5 hours, move to -3200  
> After 6 hours, move to 0  
> After 7 hours, move to 3200  
> After 8 hours, move to 6400  
> After 11 hours, move to 0  
> If the button is pressed, move to 0 and do nothing for 2 hours.

is this a correct description of what you want the code to do?  
confirm or correct.

If it is **not** correct post a corrected description in the style like johnwasser has written it.  
the character of how johnwasser described it is  
avoiding **all** programming terms  
just use  
time and step-positions

You are trying to reset function millis() to zero.  
This works for an arduino uno just fine.  
The

> [@say2k](#):
>
> Arduino Uno Wifi Rev2

this board uses the **ATmega4809** and a different core.  
Core here means the basic code that "translates" the C++-functions like pinMode(), digitalWrite() etc. to adress the **real** hardware of the ATmega4809.

The people who have written this core seem to have decided to not use the core-variable  
**timer0\_millis** anymore.

You should'nt mess around with core-variables anyway. If you manipulate core-variables you are in the danger of screwing up things.  
Your code does some timing things which can be quite easy done **without** resetting the function millis().

You seem to not yet fully understand how function millis() works and how to use it.

I have written a tutorial that shall explain timing how you are using it.  
This tutorial is dedicated to beginners and shall be explicitly easy to understand.  
To improve the tutorial questions are always welcome.

> [@Example-code for timing based on millis() easier to understand through the use of example-numbers / avoiding delay()](https://forum.arduino.cc/t/example-code-for-timing-based-on-millis-easier-to-understand-through-the-use-of-example-numbers-avoiding-delay/974017):
>
> non-blocking timing. Execute code only from time to time. There are a lot of different ways to learn programming. This thread wants to add another approach that is different to the yet existing ones. UPDATE 06.01.2023 if you are mainly interested in applying non-blocking timing you can do a quick read of this short tutorial / demonstration If you are intersted in understanding the details how it works go on reading here. I use an everyday analogon in this post to explain the basic principle …

best regards Stefan

---

_[View the full topic](https://forum.arduino.cc/t/timer0-mills-error/1118362)._
