Program selection

Dear All,

may I can get some inputs from your side about my current execution issue :-[

General, my Arduino shall carry out different programs, based on the input putton selection.

In the void loop() section I want to deviate each programm function into a own loop based on the switch case function. From program start i set the mode into N0. So programm loop will be carried out at N0-case.

Due I have only one input taster available I wanted to switch to another programm function with the counting of the pressed button within a defined time frame. eg: pressed twice a push button within 3 seconds means case N3 has to be carried out.

I wanted to use the input button as an interrupt and wanted to count in the ISR the amount of button activation.
But this want work due millis() and also Timer are not available in ISR.

Does somebody have an idea how I can prevent this?

Is it may possible to jump from ISR routine into defined position of the void loop() function

I appreciate you ideas and comments!

Thanks in advance.

chivas

Did you read this before posting a programming question and note the advice about posting code when requesting help ?

Jumping out of an ISR to a predefined location is in general a very bad idea.

Why don't you check the button in each of your 'programs' and take action based on that? If the button is pressed, increment the identifier that indicates which 'program' must run, terminate current 'program' and go back to loop().

Thanks for your input. I thought about it and I will program it in that way that I don't use the interrupt. I will make a step chain programm using markers and IF condition. I will check permanently input chanel and then I will activate a positive trigger counter to choose the program.

Regards.