Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Coding .help


#21

It looks like your code uses the goto function to immediately start running your main_loop code, which repeatedly sets the positions of servos 1 and 2 without a delay and does not exit. So, your code is basically just running:

begin 4460 1 servo 7616 1 servo 7000 2 servo 2000 2 servo repeat

I recommend using the “Step Script” button to step through your code to see what is happening and when. You can watch values get added and removed from the stack and a cursor helps you identify which part of your code is being executed.

Also, it looks like you are not using channel 3 in your code, which you mentioned you were using to control your LEDs. So, unless you incorporate that into your code, you should not expect to have control of your LEDs.

Additionally, to expand on what Amanda mentioned earlier, setting a value of 20,000 is also not that meaningful, since it basically gets truncated.

-Jon


#22

So the first line in the script is goto main loop, would I change that to something else? I looked at command reference and didn’t find anything
Marcus


#23

Just changing the goto reference in the first line will not address the issue, which is that none of the subroutines in your script are being called. You should look at the Maestro scripting examples in the Maestro User’s Guide to see how they call and use subroutines. In general, it seems like it might be helpful for you if you learn more of the basics of programming. You might try looking for more in-depth documentation on the FORTH language.

-Jon