I believe that the angle is in 1/10th of a degree. So base of +-900 is +-90 degrees...
But more to the issue. I am not sure which program you are using. If you are using something like a striped down version of rover V1.2.bas, then The issues are, that once your code is done, you go back into the main loop, you will see something like:
Code:
main:
#IF EnableFSR=1
;Read analog input
adin GripperFSRPin, GripperPressure
#ELSE
GripperPressure=1000
#ENDIF
;Read remote input
GOSUB Ps2Input
; rover stuff removed...
;[ARM CALCULATIONS]
;Inverse Kinematic calculations
GOSUB ArmIK [WristPosX, WristPosY, GlobalGripperAngle1]
ShoulderAngle1 = -IKShoulderAngle1+900
ElbowAngle1 = IKElbowAngle1+900
WristAngle1 = -IKWristAngle1
GOSUB CheckLimits
GOSUB WaitForPrevMove ;Wait for servos to finish the previous move
IF ArmOn THEN
IF ArmOn AND Prev_ArmOn=0 THEN
Sound P9,[60\4000,80\4500,100\5000]
gosub InitArm
GlobalGripperAngle1=0
ENDIF
GOSUB Movement[-BaseAngle1, -ShoulderAngle1, -ElbowAngle1, -WristAngle1, -Gripper1, -WristRotateAngle1, 50]
What you notice here is that as soon as the code goes back to Main: it checks for new PS2 input or in your case, it completes the call to PS2Input and then calls:
Code:
GOSUB ArmIK [WristPosX, WristPosY, GlobalGripperAngle1]
Which uses those 3 variables to calculate the new angles for the different servos and then a little more stuff and then calls off to Movement with it's own calculated values.
Some options that may work for you:
a) Set some mode variable when you press your button, that says, don't do anything else in main loop. Question would be how to clear it again... Sort-of how the on/off works... Could be press same button again on PS2 to clear. Could add code that if any of the 4 joystick values are out of the dead-band, to clear the flag...
b) Have your code set those 3 values...
Kurt