Discussion forum for the BasicX family of microcontroller chips.
|
Can anyone help me with some sample code? I am trying to run my gws servo motors continuously forward and in reverse. I cut the restricting dog off so that the servos will rotate, but I cant find any sample code for continuous run. Thanks for your help! |
|
|
|
--- In , "yirga10" <yirga10@y...> wrote: > > Can anyone help me with some sample code? > > I am trying to run my gws servo motors continuously forward and in > reverse. > > I cut the restricting dog off so that the servos will rotate, but I > cant find any sample code for continuous run. Thanks for your help! Assuming you still have the little circuit board inside the servo, you will use the same code as for normal servo operation: use PulseOut to send a 1 to 2 ms pulse to the servo. It will run one way on a 1 ms pulse and the other way on a 2 ms pulse. The potentiometer that formerly read the servo position can be used to adjust so that the servo is off at a 1.5 ms pulse width. Or you can remove the potentiometer (replacing it with two equal value resistors to form a voltage divider) and adjust the pulse width to get the servo to stop. Each servo will be a little different. |
|
|
|
Thanks for your help...I think I am just about there!!! --- In , "nathanchronister" <nathanchronister@y...> wrote: > > --- In , "yirga10" <yirga10@y...> wrote: > > > > Can anyone help me with some sample code? > > > > I am trying to run my gws servo motors continuously forward and in > > reverse. > > > > I cut the restricting dog off so that the servos will rotate, but I > > cant find any sample code for continuous run. Thanks for your help! > Assuming you still have the little circuit board inside the servo, > you will use the same code as for normal servo operation: use > PulseOut to send a 1 to 2 ms pulse to the servo. It will run one way > on a 1 ms pulse and the other way on a 2 ms pulse. > > The potentiometer that formerly read the servo position can be used > to adjust so that the servo is off at a 1.5 ms pulse width. Or you > can remove the potentiometer (replacing it with two equal value > resistors to form a voltage divider) and adjust the pulse width to > get the servo to stop. Each servo will be a little different. |