I haven’t added the feedback portion of code yet because i cant even get my servos to move with this. can anybody help
;SYSTEM VARIABLES
LANKLE CON P4
LKNEE CON P5
LHIP CON P6
RANKLE CON P7
RKNEE CON P8
RHIP CON P10
COUNT1 VAR BYTE
COUNT2 VAR BYTE
COUNT3 VAR BYTE
RATE1 VAR BYTE
RATE2 VAR BYTE
RATE3 VAR BYTE
DELAY VAR BYTE
PX VAR BYTE
POSITION VAR SWORD
JOINTANGLE VAR SWORD
JOINTANGLE =(1500/90)
RATE1=90
RATE2=90
RATE3=6
DELAY=40
;BUTTON INTERFACE
BUTTON P12,0,DELAY,RATE1,COUNT1,1,ADDITION
BUTTON P13,0,DELAY,RATE2,COUNT2,1,SUBTRACT
BUTTON P14,0,DELAY,RATE3,COUNT3,1,BLANK
;START OF PROGRAM
INITIALSTATE
ENABLEHSERVO
HSERVO [LANKLE\0\0]
HSERVO [LKNEE\0\0]
HSERVO [LHIP\0\0]
HSERVO [RANKLE\0\0]
HSERVO [RKNEE\0\0]
HSERVO [RHIP\0\0]
IF COUNT3=0 THEN
GOTO INITIALSTATE
ELSE
GOTO JOINTTEST
ENDIF
JOINTTEST
IF COUNT3=1 THEN
PX=LANKLE
ELSEIF COUNT3=2
PX=LKNEE
ELSEIF COUNT3=3
PX=LHIP
ELSEIF COUNT3=4
PX=RANKLE
ELSEIF COUNT3=5
PX=RKNEE
ELSE
PX=RHIP
ENDIF
ADDITION
HSERVO [P4(JOINTANGLECOUNT1)\100]
GOTO JOINTTEST
SUBTRACT
HSERVO [PX(JOINTANGLECOUNT1)-(1200)\100]
GOTO JOINTTEST
BLANK
GOTO JOINTTEST