Shop OBEX P1 Docs P2 Docs Learn Events
the nature of pulsout/in — Parallax Forums

the nature of pulsout/in

davidsdavids Posts: 64
edited 2005-06-20 11:35 in BASIC Stamp
Well I have been using the pulsout command abit lately I started to wonder if the command such as PULSOUT 14, 500 or PULSOUT 14, VARABLE ·can be changed to use the eeprom to load the different pulses need in robots.· Maybe a write command or a get command mite work with the PULSOUT/ in command aswell.·

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-06-19 12:53
    Note: This web based forum ATE my first post, LONG before I was finished. Then, after I told it I wanted to re-edit the truncated post, it took about 5 minutes for it to download it again to my screen. If anyone sees this as progress you must have been drinking the Kool Aide TOO! This is UTTER NONSENSE!)

    davids -

    Sure, absolutely no reason why not. All of the parameters necessary for PULSOUT can be specified as constants, variables or expressions (per the Help File and the PBASIC Stamp Manual), so something like the following would be fine:

    Issue_Pulsout_EEPROM:

    ···Location = Location + Location_Width· ' Use only if necessary
    ···Read······· Location, Variable_Name····· ' Fetch PULSOUT value from EEPROM
    ···PULSOUT· Pin_Number, Variable_Name· ' Issue variable PULSOUT

    I know of no way to do it in one command, but statements 1 (if required)·and 2 above could certainly be combined into one statement.

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 6/19/2005 1:08:00 PM GMT
  • davidsdavids Posts: 64
    edited 2005-06-20 06:22
    Bruce,

    Thank for that advise, but before I posted the question I'm sure that I checked the book to see if it could be done. If you mite post a link to it I'd very much like to see what it says about the action
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-06-20 07:02
    davids -

    Since you must download either the Help File or the PBASIC Stamp Manual, it would be a bit difficult to offer a link to it. Here is a direct copy of the beginning of the PULSOUT documentation from the PBASIC Stamp Editor's Help File:

    quote

    Syntax: PULSOUT Pin, Duration

    Function

    Generate a pulse on Pin with a width of Duration.

    Pin is a variable/constant/expression* (0 - 15) that specifies the I/O pin to use. This pin will be set to output mode.

    Duration is a variable/constant/expression* (0 - 65535) that specifies the duration of the pulse. The unit of time for Duration is described below.

    * Note: Expressions are not allowed as arguments on the BS1. The range of the Pin argument on the BS1 is 0 - 7.

    end quote

    If you need more than that, just let us know. The key to the answer for your original question is contained in "Duration is a variable/constant/expression".

    Regards,

    Bruce Bates
  • davidsdavids Posts: 64
    edited 2005-06-20 11:35
    Bruce,

    I have got the basic idea now,
    Thank you very much for making it clear. I'll see if using this method makes things easier...... I looked up DATA, WRITE & READ after i posted you,

    I also looked up GET and POLLING commands as well. Things are making sense to me now. I'll test things out on the PICO again

    I' may change the code around and I'll see what happens.
    (and I hope for the best)

    Thank you,

    Regards
    David

    Post Edited (davids) : 6/20/2005 11:40:22 AM GMT
Sign In or Register to comment.