Currently i am working on a project with buttons and a servo.
I want the circuit to let the user control the servo, and if needed, store the actual position of the servo.
I managed to get the circuit working flawlessly.
But now i am curious:
I am working with the Buttonlibrary and have a "record" button and some "slot" buttons.
Currently i am checking whether the "record" button is held down, and if another slot button is held down simultaneously.
I want to implement a "record mode", so that i press the record button, then a LED goes on, and nothing happens until one of the slot buttons is pressed, the variable is stored, and it exits the "record mode"
I dont have any clue how to do this, as the void loop() is running through and through and i cant stop it until something happens.
When the "record" button is pressed, call a function that loops, checking the state of the "slot" buttons, until the state of one of the "slot" buttons changes to pressed.
How can i exit the "void checkbuttons();" if a button ist pressed and go back to the void loop(); ? I searched the Arduino-Reference, but i cant find anything like "exit".