Pulsout troubles
Archiver
Posts: 46,084
Happy new year to all,
My project is to make a robotic arm using modified servos.
The program that I wrote is the following:
input 0
high 0
input 1
high 1
get_status:
if in0 = 0 then up
if in1 = 0 then down
goto get_status
up:
low 2
pulsout 2 , 1000
pause 20
goto get_status
down:
low 2
pulsout 2 , 500
pause 20
goto get_status
The problem is that servos turning counterclockwise
eather I press the 1st button or I press the 2nd button.
What sould I do to make them turning both clockwise and
counterclockwise ?
Thank you,
Thomas
Do You Yahoo!?
My project is to make a robotic arm using modified servos.
The program that I wrote is the following:
input 0
high 0
input 1
high 1
get_status:
if in0 = 0 then up
if in1 = 0 then down
goto get_status
up:
low 2
pulsout 2 , 1000
pause 20
goto get_status
down:
low 2
pulsout 2 , 500
pause 20
goto get_status
The problem is that servos turning counterclockwise
eather I press the 1st button or I press the 2nd button.
What sould I do to make them turning both clockwise and
counterclockwise ?
Thank you,
Thomas
Do You Yahoo!?
Comments
"pulsout 2,500" should make it turn clockwise.
--- In basicstamps@yahoogroups.com, tik tak <th_sak@y...> wrote:
>
> Happy new year to all,
>
> My project is to make a robotic arm using modified servos.
> The program that I wrote is the following:
>
>
> input 0
> high 0
> input 1
> high 1
>
> get_status:
>
> if in0 = 0 then up
> if in1 = 0 then down
> goto get_status
>
> up:
> low 2
> pulsout 2 , 1000
> pause 20
> goto get_status
>
> down:
> low 2
> pulsout 2 , 500
> pause 20
> goto get_status
>
> The problem is that servos turning counterclockwise
> eather I press the 1st button or I press the 2nd button.
> What sould I do to make them turning both clockwise and
> counterclockwise ?
>
> Thank you,
>
> Thomas
>
>
>
>
>
>
> Do You Yahoo!?
>
(I had pullup resistors in series to buttons).
Note that both servos are modified to turn continuously
but with these commands they sould turn to both sides.
'Robotic arm project
'
Initialization
input 0 'Set P0 to input
input 1 'Set P1 to input
low 2 'Set P2 to output-low
'
Main routine
get_status:
if in0 = 0 then up
if in1 = 0 then down
goto get_status
'
Full speed reverse
up: 'Turn counterclockwise
pulsout 2 , 500 'Send 1.0 ms pulses to P2
pause 20 'every 20 ms.
debug " arm up " 'Open the debug window and display arm up.
goto get_status 'Go to get_status
'
Full speed ahead
down: 'Turn clockwise
pulsout 2 , 1000 'Send 2.0 ms pulses to P2
pause 20 'every 20 ms.
debug " arm down " 'Open the debug window and display arm down.
goto get_status 'Go to get_status
Thanks again,
Thomas
Do You Yahoo!?