Shop OBEX P1 Docs P2 Docs Learn Events
Pulse out — Parallax Forums

Pulse out

aev.308aev.308 Posts: 6
edited 2011-08-19 18:28 in BASIC Stamp
I'm having a problem using the PULSE OUT XXXX command. I would like XXXX to be a variable so that I can write a very short program rather than creating a bunch of subroutines with different values for XXXX.

My programs pass debugging and download with no problem but the servo never moves to the position determined by a simple algorithm such as.

var x
var dist

some distance calculation = dist

x = dist + 25

pulse out x

Any suggestions?

Comments

  • ercoerco Posts: 20,256
    edited 2011-08-18 19:24
    Should work! Of course the command is PULSOUT pin,duration . And you have to keep sending it with pause 20's. Try this:

    FOR B1=500 to 1000
    PULSOUT 1,B1
    PAUSE 20
    NEXT

    Now you make it go back the other way!

    (Pin 1 is used there for the output signal)
  • aev.308aev.308 Posts: 6
    edited 2011-08-19 17:18
    thanks. guess i will have to revisit this one when i get a chance.
  • ercoerco Posts: 20,256
    edited 2011-08-19 18:28
    Don't leave me hanging, aev! :)
Sign In or Register to comment.