joystick var word 'declare variables for the joystick and actuator feedback potmeter var word high 0 'initialize pins 0 and 6 to HIGH (no voltage) high 6 check: 'CHECK function to determine the position of the joystick and react high 5 'initialize pins 5 and 4 to HIGH (no voltage) to get RCTIME high 4 low 3 'initialize pins 3 and 2 to LOW (5V) for RCTIME low 2 pause 10 'to allow capacitor to get charged rctime 5,1,joystick 'RCTIME for the joystick and actuator as a means of getting a resistance value rctime 4,1,potmeter debug dec ?joystick 'display the RCTIME values for both the joystick and actuator onto the screen debug dec ?potmeter if joystick=1 then extend 'IF statements to determine whether we tilt up or down based on RCTIME values if joystick>1000 then retract goto nothing 'GOTO NOTHING function if the joystick is in the center then do nothing goto check 'repeat CHECK function forever nothing: 'NOTHING function if joystick in center then turn off both pins 0 and 6 high 0 high 6 goto check 'go back to CHECK where the joystick is extend: 'EXTEND the joystick upward by shutting pin 6 off and pin 0 on low 0 high 6 goto check 'go back to CHECK where the joystick is retract: 'RETRACT the joystick downward by shutting pin 0 off and pin 6 on low 6 high 0 goto check 'go back to CHECK where the joystick is