I have an application where I need to run a motor for certain on/off times based on user input. I would like to use a 12 position rotary switch and have set run times based on the switch position. My problem is that I need to be able to cancel a previous run time if someone changes the position of the switch before the previous set time has expired.
For example: Set time 1:
On for 1 minute off for 8 hours.
So if someone turns the switch to a different position during the 8 hour off countdown I currently have to wait untill the 8 hours is over before the new setting is run in the loop.
Is there a way to solve this? Keep in mind I have 12 different modes with differing times.