Using millis for time delay for (push ON/OFF button)

crimony:
Also you shouldn't need the abs() calls as the type of your "timep" and "time" variables will be "unsigned long" already.

yea crimony, but the millis button will overflow back to 0 after 50 days, that time the "timep-time" would go negative and the condition without abs "(timep-time) <= timedelay" would be satisfied for 50 more days :stuck_out_tongue:

thats why i included the abs function, or is it not necessary or am i overlooking something?

and thanks crimony and Pauls, will post the final code in few mins :smiley: