'{$STAMP BS2} '{$PBASIC 2.5} ' servo control DEBUG "ready",CR one VAR Bit 'state of the hall effect sensor no. 1 two VAR Bit 'state of the hall effect sensor no. 1 three VAR Bit 'state of the hall effect sensor no. 1 '============================= counter VAR Word ' counts the passes the servo has taken time CON 30 ' how long the servo holds position Main: one=IN0 two=IN1 three=IN2 IF one=0 THEN first IF two=0 THEN second IF three=0 THEN third GOTO Main '========================================================================================================================== first: DEBUG "0 to 100 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 350 'outputs from pin 14 PAUSE 20 '20ms pause NEXT GOTO main second: DEBUG "101 to 200 lbs", CR FOR counter = 1 TO time PULSOUT 14, 400 PAUSE 20 NEXT GOTO main third: DEBUG "201 to 300 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 450 'outputs from pin 14 PAUSE 20 NEXT '20ms pause GOTO main DEBUG "301 to 400 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 500 'outputs from pin 14 PAUSE 20 NEXT '20ms pause DEBUG "401 to 500 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 550 'outputs from pin 14 PAUSE 20 NEXT '20ms pause DEBUG "501 to 600 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 600 'outputs from pin 14 PAUSE 20 NEXT '20ms pause DEBUG "601 to 700 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 650 'outputs from pin 14 PAUSE 20 NEXT '20ms pause DEBUG "701 to 800 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14,700 'outputs from pin 14 PAUSE 20 '20ms pause NEXT DEBUG "801 to 900 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 750 'outputs from pin 14 PAUSE 20 '20ms pause NEXT DEBUG "901 to 1000 lbs", CR FOR counter = 1 TO time ' for counter = how long to hold PULSOUT 14, 800 'outputs from pin 14 PAUSE 20 '20ms pause NEXT GOTO main