Miltos
12-22-2011, 07:41 PM
After reading a lot of articles "how to modify a standard servo for continous rotation", I succesfully alter my futaba s3003 for continous rotation. Nevertheless the servos run with non stop for a counter loop from 1 to 256 (and above), see code below:
' {$STAMP BS2}' {$PBASIC 2.5}
'------------- Variables --------------
counter VAR Byte 'variable for PULSOUT loop
PBin VAR IN2 'PushButton for PIN2
'------------- Constants ---------------
SERVO_Right CON 12 ' Right Servo
SERVO_Left CON 13 ' Left Servo
start:
FOR counter = 1 TO 259
PULSOUT SERVO_Left, 850
PULSOUT SERVO_Right, 650
PAUSE 20
NEXT
standby:
DEBUG "Stanby mode",CR
IF PBin = 0 THEN start
GOTO standby:
How can I make the servos run for let's say 2 min...as any end value above 250 will make them run for ever???
Any help will be much appreciated.
' {$STAMP BS2}' {$PBASIC 2.5}
'------------- Variables --------------
counter VAR Byte 'variable for PULSOUT loop
PBin VAR IN2 'PushButton for PIN2
'------------- Constants ---------------
SERVO_Right CON 12 ' Right Servo
SERVO_Left CON 13 ' Left Servo
start:
FOR counter = 1 TO 259
PULSOUT SERVO_Left, 850
PULSOUT SERVO_Right, 650
PAUSE 20
NEXT
standby:
DEBUG "Stanby mode",CR
IF PBin = 0 THEN start
GOTO standby:
How can I make the servos run for let's say 2 min...as any end value above 250 will make them run for ever???
Any help will be much appreciated.