Heyy guys, I'm working on a project that involves calculating the time for which a button is pressed and held as such and the time interval between two consecutive button presses where the button is not pressed. Is there any code snippets that I can use for the above two functionalities?
Basically save the millis() value when the button [u]becomes[/u] pressed and again when it [u]becomes[/u] released. The difference between the two is the number of milliseconds during which the button was pressed.
Use the same principle for your other question.
Why not read the answer you got on StackExchange, or do you just enjoy having people all over everywhere writing code for you?
@DKWATSON I'm not sure if u saw the post on stack exchange later, The code actually didn't work and I had further doubts on it which I asked over there. Unfortunately, those doubts are left uncleared over there and that is the reason I thought of posting it here.