by Pev » Fri May 05, 2006 7:29 am
by Pev
Fri May 05, 2006 7:29 am
H3dude wrote:Pev wrote:The servo is attached to port 9 and accessed using the servo command, format SERVO 9, {degree} where {degree} is a value from 10 to 190.
Pev, this syntax doesn't seem to do anything in my standard pose block nor in my zero settings:
standard_pose:
SERVO 11, 98
MOVE G6A, 100, 76, 145, 93, 100, 100
MOVE G6D, 100, 76, 145, 93, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
WAIT
RETURNI also tried a simple move
head_turn_no:
SPEED 5
SERVO 11,98
SERVO 11,30
SERVO 11,160
SERVO 11,98
GOSUB standard_pose
RETURNalas, again I am clueless. Any ideas?
Hi,
Looking at your code you have the additional servo plugged into port 11, but your not calling your head_turn_no routine in the code snippet you have posted. If you want him to turn his head every time he enters standard pose I'd go for something like this:
standard_pose:
SERVO 11, 98
MOVE G6A, 100, 76, 145, 93, 100, 100
MOVE G6D, 100, 76, 145, 93, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
WAIT
GOSUB head_turn_no
RETURN
head_turn_no:
SPEED 5
SERVO 11,98
deley 500
SERVO 11,30
delay 500
SERVO 11,160
delay 1000
SERVO 11,98
delay 500
RETURN
I've added the delays just to ensure that servo has time to move. I was using a standard non-digital non feedback servo so if I wasn't careful the servo didn't move as it never had time to.
Hope this makes sense
Pev
PS - if it helps when I was using the sharp IR sensor attached to AD port 1 I used the following code to move the head servo and check the sensor:
SERVO 9, 30 'move head servo to left position
DELAY 3000
LEFT = AD(1) 'Read Sonar on Sonar Port 5
'Check Right
SERVO 9, 190 'move head servo to right position
DELAY 4000
RIGHT = AD(1)
SERVO 9, 108 'move head to center position
DELAY 1000
So he looked left and checked the sesor then looked right and checked the sensor.
H3dude wrote:Pev wrote:The servo is attached to port 9 and accessed using the servo command, format SERVO 9, {degree} where {degree} is a value from 10 to 190.
Pev, this syntax doesn't seem to do anything in my standard pose block nor in my zero settings:
standard_pose:
SERVO 11, 98
MOVE G6A, 100, 76, 145, 93, 100, 100
MOVE G6D, 100, 76, 145, 93, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
WAIT
RETURNI also tried a simple move
head_turn_no:
SPEED 5
SERVO 11,98
SERVO 11,30
SERVO 11,160
SERVO 11,98
GOSUB standard_pose
RETURNalas, again I am clueless. Any ideas?
Hi,
Looking at your code you have the additional servo plugged into port 11, but your not calling your head_turn_no routine in the code snippet you have posted. If you want him to turn his head every time he enters standard pose I'd go for something like this:
standard_pose:
SERVO 11, 98
MOVE G6A, 100, 76, 145, 93, 100, 100
MOVE G6D, 100, 76, 145, 93, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
WAIT
GOSUB head_turn_no
RETURN
head_turn_no:
SPEED 5
SERVO 11,98
deley 500
SERVO 11,30
delay 500
SERVO 11,160
delay 1000
SERVO 11,98
delay 500
RETURN
I've added the delays just to ensure that servo has time to move. I was using a standard non-digital non feedback servo so if I wasn't careful the servo didn't move as it never had time to.
Hope this makes sense
Pev
PS - if it helps when I was using the sharp IR sensor attached to AD port 1 I used the following code to move the head servo and check the sensor:
SERVO 9, 30 'move head servo to left position
DELAY 3000
LEFT = AD(1) 'Read Sonar on Sonar Port 5
'Check Right
SERVO 9, 190 'move head servo to right position
DELAY 4000
RIGHT = AD(1)
SERVO 9, 108 'move head to center position
DELAY 1000
So he looked left and checked the sesor then looked right and checked the sensor.