1

I am now working on a project which is expected to last at least 5 years from the time it is completed. In that project, i can not use delay() for some purposes so I am using millis() method

unsigned long Then = 0;
unsigned long Threshold = 1000;

void setup(){ // Codes }

void loop(){ unsigned long Now = millis(); if(Now-Then>=Threshold){ // Execute a function or functions Then = Now; } }

Now in this code wee can see the variable 'Then' and 'Now' are getting updated whenever threshold is met.

So now, suppose after a certain period of time (without any switch off), if any one of the two ever-updating variables which are 'Now' or 'Then' gets a value which is out of range for 'unsigned long' type

Will the ic continue to behave normally or will it malfunction?

Thank you!

0 Answers0