Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | To control movement of servo

Discussion forum for the BasicX family of microcontroller chips.

To control movement of servo - yogafire27 - Mar 7 0:33:00 2004

Hi,

can anyone help me with the program to control the servo motor

I am not sure what the program below is supposed to do

Option Explicit

Public Sub Main()
Dim i as byte

Do
for i = 1 to 50
pulseout 10, 0.002,1 'Servo moves in one direction
delay 0.02
next

for i= 1 to 50
pulseout 10,0.0015,1 'Servo is not moving
delay 0.02
next

for i= 1 to 50
pulseout 10,0.001,1 'Servo moves in opposite direction
delay 0.02
next

loop

End Sub

If you can, pass me a simple program to control the servo that turns
only 180 degrees.(HS-322HD) i can finish controlling the servo.

i am using this for my project.

I have very little knowledge over the programming.

I used this program but I must change the pin to 5 when my input is
at 10 Why??

does this program interfere with the L293.

Thanks
Yoga






(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: To control movement of servo - Thad Larson - Mar 7 15:04:00 2004

Your servo should have three wires.

Connect Red to +4.8 - +6 volts
Connect Black to ground
Connect Yellow to pin 10

It is preferred that the servo gets it's power from a
separate power source than the BX, so it doesn't "rob"
the power.

If you still have trouble, add "Call" and parenthesis
to your statements:

Call PulseOut (ServoPin, PulseWidth, 1)
Call Delay (0.02)

Save your L293 for any small DC motors that you may
need.

Thad

--- yogafire27 <> wrote:
> Hi,
>
> can anyone help me with the program to control the
> servo motor
>
> I am not sure what the program below is supposed to
> do
>
> Option Explicit
>
> Public Sub Main()
> Dim i as byte
>
> Do
> for i = 1 to 50
> pulseout 10, 0.002,1 'Servo moves in one
> direction
> delay 0.02
> next
>
> for i= 1 to 50
> pulseout 10,0.0015,1 'Servo is not moving
> delay 0.02
> next
>
> for i= 1 to 50
> pulseout 10,0.001,1 'Servo moves in opposite
> direction
> delay 0.02
> next
>
> loop
>
> End Sub
>
> If you can, pass me a simple program to control the
> servo that turns
> only 180 degrees.(HS-322HD) i can finish controlling
> the servo.
>
> i am using this for my project.
>
> I have very little knowledge over the programming.
>
> I used this program but I must change the pin to 5
> when my input is
> at 10 Why??
>
> does this program interfere with the L293.
>
> Thanks
> Yoga
__________________________________






(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: To control movement of servo - Francisco Lobo - Mar 8 3:00:00 2004

How much current would a tipical servo take?

Is there any code to read an RC Receiver and then throw the action to a
servo?, if yes, would the power of the BX will be enough to read from 7 or
6 channels of a receiver and write to 6 or 7 servos? What does the Pulseout routin would look like in pseudocode? i don't mean
the syntax, i just want to know how does it achieves a pulseout on a
desired pin. Same for pulsein. Thanks
Bye





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )