How can I create Time interrupt that triggers after 2 minutes on uno
How can I create Time interrupt that triggers after 2 minutes on uno
You can use the Millis() timer to check, and do whatever you want after the time reached.
You need to declare it as more than an int ( long will work)
I use a 30 second one in one of my sketches
int ButtonTimeout = 30000;
// Timeout if no button is pressed. Note wipe interval is lower than this. [30 seconds]
unsigned long ButtonPressTime = 0;
// Time the last button was pressed.
if (((millis()-ButtonPressTime) > ButtonTimeout) && (IntWipe == 1))
// 30 Sec timeout for no button press, but only after stopped, or 1 start.
{
IntWipe = 0;
LastWipeTime = 0;
WipeInterval = 0;
}
mark
You can use the Millis() timer to check, and do whatever you want after the time reached.
You need to declare it as more than an int ( long will work)
I use a 30 second one in one of my sketches
int ButtonTimeout = 30000;
// Timeout if no button is pressed. Note wipe interval is lower than this. [30 seconds]
unsigned long ButtonPressTime = 0;
// Time the last button was pressed.
if (((millis()-ButtonPressTime) > ButtonTimeout) && (IntWipe == 1))
// 30 Sec timeout for no button press, but only after stopped, or 1 start.
{
IntWipe = 0;
LastWipeTime = 0;
WipeInterval = 0;
}
mark