Is the there a β€wait until’ function which stops the code till a defined event occurs?
e.g. for the macro
Line 1: Display a value on LCD
Do nothing and wait until any button is pressed
If any button not pressed for 5 seconds go to somewhere else/end macro.
Increment value by one if it is button A
Or decrement by 1 if button B.
Go to line 1
Only way I can think of implementing this is using a loop (instead of β€wait until’) which runs continuously until a counter reaches a certain value. On each run through the loop the buttons are read and the value in/decremented according to any button pressed. Also a counter is incremented by one for each loop pass and is reset to zero for every button press.
If no button is pressed for 5 seconds the counter reaches the certain value so that the loop ends.