Standard Servo
Manetheren
Posts: 117
I had a question about the standard servo.·
I am building a project for school using a standard servo as a gate that opens and closes to allow a BOE-Bot through and wanted to know if it can be made to remember what position it is on and not have to fully open to close or fully close to open.·
·I also need it to check the sensor to see if the bot is through the gate before it closes or while it is closing.
I am building a project for school using a standard servo as a gate that opens and closes to allow a BOE-Bot through and wanted to know if it can be made to remember what position it is on and not have to fully open to close or fully close to open.·
·I also need it to check the sensor to see if the bot is through the gate before it closes or while it is closing.
Comments
'Initialization
Reset:
FOR temp = 200 TO 200························ 'Reset the cate to closed'
PULSOUT Servo_pin,temp
PAUSE 20
NEXT
GateCode:
IF (CloseGate = 1) THEN
FOR temp = Temp TO 200········ 'Use currently stored word for TEMP as starting point.
PULSOUT Servo_pin,temp
PAUSE 20
IF (interlock = 0)THEN············ 'Break the loop when the gate reaches the latch.'
Gate = 2
GOTO main
ENDIF
NEXT
ELSEIF (OpenGate = 1) THEN
FOR temp = Temp TO 700
PULSOUT Servo_pin,temp
PAUSE 20
IF (interlock = 0) AND (closegate = 1) THEN············ 'Break the loop if the BOT reaks INTERLOCK while gate is closing.'
gate = 2
GOTO main
ENDIF
NEXT
ENDIF
200 to 200 is at most one time through the loop.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Manetheren