hello everyone,
i wanted to ask if somebody can help me with calculating the duration of the time period. i wanted to code in a way that if the value of current (amps) goes above 2A the time tracker begins with counting the time and when it is below the 2A it stops with counting. in this way i wanted to have a clear understanding of when the machine is running and when it is stoped with production.
Note the time (millis) when the current exceeds the threshold.
Note the time when the current drops below the threshold.
Subtract the first timestamp from the second.