Shop OBEX P1 Docs P2 Docs Learn Events
unmodified servo and bs2-sx — Parallax Forums

unmodified servo and bs2-sx

ferretonthelusferretonthelus Posts: 9
edited 2006-04-12 18:30 in BASIC Stamp
ok, first I do not have the board of education, just a simple perf board with pin to pin connections to male header. 5volt regulator, power led, and reset button (momentary, n/o). eyes.gif·now I just need a simple program to move my servo center, right, left. so far because of the speed (i guess) i have not been able to find even the simplest code (without the BOE) to adddress this. It seems to be different than the PIC's i have programmed with, mostly in being simpler. maybe to simple confused.gif. But if anyone can help the newbie (me) get this jumpstarted I would be greatly in your debt. Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ferrets are funny little animals

Comments

  • JonathanJonathan Posts: 1,023
    edited 2006-04-12 16:19
    Ferret,

    Not having the BOE makes no difference. All you need to do is send a pulse of the correct width to the servo. A pulse of 1500uS or so should center the servo, a pulse of 2000uS should make it go to the far end one way, and a pulse of 1000uS should make it go to the far end the other way. With the Basic Stamp, the command to use is PULSOUT, like this:



    main:
    PULSOUT ServoPin, pulseLength
    pause 20
    goto main


    I do not know what Stamp you are using, and different Stamps have different PULSOUT resolutions. Check the docs for the one you are using. For example, the BS2 has a 2uS resolution. So, to send a pulse of 1500uS (to center the servos) you would use:

    PULSOUT servoPin, 750

    HTH,

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • ferretonthelusferretonthelus Posts: 9
    edited 2006-04-12 17:44
    in my subject I show i have the sx, whic is the fastest micro I have used. thanks for your time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ferrets are funny little animals
  • JonathanJonathan Posts: 1,023
    edited 2006-04-12 17:56
    Ferret,

    Quite right, you did mention the SX in the subject. Not enough coffee smile.gif

    The B2sx has a PULSOUT resolution of .8uS. So, to set the servo to ~ center, try a PULSOUT value of 1875.

    HTH,

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • ferretonthelusferretonthelus Posts: 9
    edited 2006-04-12 18:30
    ok, great, as far as my comment about the boe, All I could find so far was answers in regards to that fixture. Thanks so much.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ferrets are funny little animals
Sign In or Register to comment.