I would like to add some change to my code. If I press to any of the 3 buttons (a,b,c) the sequence will run once only, how can I have the sequence running in a close loop until I press again the same button to stop it? Thanks a lot…! Didier
begin
button_a if sequence_a endif
button_b if sequence_b endif
button_c if sequence_c endif
repeat
sub button_a
0 get_position 500 less_than
return
sub button_b
1 get_position 500 less_than
return
sub button_c
2 get_position 500 less_than
return
sub sequence_a # Pre-breaking 1 White button
4000 5800 frame_3 # Gaz
4000 6000 frame_3 # Neutral
return
Hello.
It sounds like you want to be able to stop a sequence at any point in the program, which would not be practical to do with a Maestro script since it does not support interrupts. You might consider using a microcontroller that supports interrupts such as an Arduino or an Arduino-compatible board (like the A-Star programmable controllers). The microcontroller can handle the button triggers and send commands to the Maestro based on those events. If you do decide to use the Arduino (or A-Star), you can use the Arduino library for the Maestro to send commands the Maestro via its serial interface. It might be helpful to look at the examples in the Arduino Maestro library to get an idea of how the library works.
- Amanda
Thanks Amanda I understand the Maestro script doesn’t support interrupts. Can you tell what I need to add in my current script to have a loop. If I have press to one of the three push button, the specific cycle starts and will not end (nostop)? Thanks for you help, Didier.
Hi, Didier.
If you want to endlessly loop through a subroutine once the corresponding button has been pressed, you could try adding BEGIN/REPEAT
blocks inside each of your sequence subroutines like so:
sub sequence_a # Pre-breaking 1 White button
BEGIN
4000 5800 frame_3 # Gaz
4000 6000 frame_3 # Neutral
REPEAT
return
- Amanda