I have not looked that carefully at the code, but one thing that I noticed is your code did things like:

Code:

elseif temp(1)=239 gosub Walk_Forward

The thing to understand is that with a PS2, it will continue to report a button as pressed as long as you are holding the button down. This works great for many things, but when you only want to execute something once you need to add a little additional code. The idea is to check the button state and the button state for the previous time through the code and only do the operation if the new state is down and old state is up... Something like:

IF (DualShock(1).bit3 = 0) and LastButton(0).bit3 THEN ;Start Button test...

LastButton(0) = DualShock(1) LastButton(1) = DualShock(2)

Note: this was extracted from a different program, that uses variable DualShock instead of Temp. It also shows which bit it is testing for versus a decimal value. Then at the end of the PS2 function it saves away the state of the buttons.

So you can see in the above code how we tested the start button to only process when it is first pressed.

I found an example in an old post in the forum. Actually it was posted by Kurte... thanks again!

Code:

if temp(1)=247 and PrevTemp(1)=255 then gosub servo_homeendifPrevTemp(1) = Temp(1)

Im not to great at programming and the little bit I do know is from using an Arduino(C++)So what I did was created a variable 'PrevTemp' and gave it an initial value of 255 then at the end of the sub routine I return it to the value 255. At the end of the MAIN I execute the 'PrevTemp(1) = Temp(1)'