the nature of pulsout/in
davids
Posts: 64
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
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
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
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
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