Shop OBEX P1 Docs P2 Docs Learn Events
Pulsin — Parallax Forums

Pulsin

Armored CarsArmored Cars Posts: 172
edited 2004-10-26 21:18 in BASIC Stamp
I cant seem to get this to work, if someone could help me out that would be great.· Im trying to read the pulse from an RC reciever and send it to an RC servo.· Ive tried this:

MANUAL:
· mansteer=PULSIN 2
· mandrive=PULSIN 3
· PULSOUT steer, mansteer
· PULSOUT drive, mandrive
· GOTO MANUAL

and this:

MANUAL:
··PULSOUT steer, PULSIN 2
· PULSOUT drive,·PULSIN 3
· GOTO MANUAL

and nethier tolkienize.· Im out of ideas.

This also leads me to another question, can I use the OEM BS2s 5v regulator to run an RC reciever or would that put too much load on it?

Comments

  • Armored CarsArmored Cars Posts: 172
    edited 2004-10-26 18:52
    Just to clerify that last question I have 6v in the VIN and was just going to hook up the reciever to the VDD.
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-10-26 21:18
    I recommend downloading the PDF of the
    "Basic Stamp Programming Manual".· It's really
    excellent.

    You used the wrong syntax on the PULSIN statement.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}


    ManSteer VAR Word
    ManDrive VAR Word
    Steer CON 4
    Drive CON 5

    · LOW Steer· ' Set default state to 0 volts
    · LOW Drive· ' Set default state to 0 volts
    MAIN:
    · ' Servo Pulse is a normally LOW signal, pulsing
    · ' high for 1 to 2 mSec.
    · PULSIN 2, 1, ManSteer ' Read pulse width in 2 uSec 'ticks'
    · PULSIN 3, 1, ManDrive

    · ' Note 'PAUSE 20' not needed here, since ManSteer and ManDrive
    · ' PULSIN should have a Pause already built in...

    · PULSOUT Steer, ManSteer· ' Since default low, PULSE high.
    · PULSOUT Drive, ManDrive
    · GOTO MAIN
Sign In or Register to comment.