Hi
I want to communicate an Arduino Mega with my MiniMaestro via Serial port. The idea is that the maestro stays doing nothing until it receives a command from the arduino. Once the maestro finishes doing the subroutine I want the maestro to go back to do nothing. The communication is working well, the problem is when the subroutine has ended and the maestro goes back to do nothing. When I run the script, the part of the script in which maestro does nothing works well, but when it returns back to that part of the script after doing a subroutine the overflow error is triggered. It says that 126 of 126 levels are used. This is the code. I get it from the arduino examples that come with the library. What am I doing wrong? I tried also blinking a led instead of doing nothing, but it still triggers the same error.
# Don't do anything by default.
begin
led
repeat
# Subroutine 0
sub alternate_mid_to_high
6000 0 servo
1000 delay
7000 0 servo
1000 delay
return
# Subroutine 1
# Expects the delay time to be on the top of the stack
sub alternate_mid_to_low
begin
6000 0 servo
1000 delay
5000 0 servo
1000 delay
repeat
sub led
900 100
led_on delay
led_off delay
return