Hello, I am going to make a "reaction test" when pressing a button, a led should light up and then change colour or something, when the light changes colour or turns off (idk what soulution) a timer should start and stop when the button is pressed again.
Right now I just want to get a working stopwatch, if it is possible i would want SecondsSeconds.Thousandths. But only hundreths would work too.
I am new but how do I get started, I want to learn coding not just copy pasting a code.
millis() returns the number of milliseconds since the processor reset.
It just counts up, forever.
If you read and record the value of millis() NOW, and read and record the value of millis() NOW, then subtract the first value from the second, then the difference is the number of milliseconds between the two events.
Okay, I kinda starts to understand, if you could, could you add “comments” like // to the code someone sent in the thread or maybe you know/have a code that is something like this one that has “comments” so I maybe could see and understand?
Start your education by reading up on the explanations of the keywords and functions used at the Arduino reference page.
There's an ocean of C++ info out there. Find a C++ tutorial/website you're comfortable with to refer to as you go along. Example: Reference - C++ Reference.