|
You should download the Parallax manual (V2.0 is worth getting if you have the older manual -- much clearer in my opinion).
Output is a Pbasic command that makes a pin an output on a Stamp2.
What it REALLY does is set a bit in the DIRS word.
There are 3 words that you should get to know if you are using Stamp2's a lot (not so much if you only use them for FIRST, but it is still good to know).
DIRS is a word that sets the direction of data flow of the I/O pins 0-15
INS is a word that reflects the status of the voltage on the I/O pins 0-15.
OUTS is a word that determines the output value of the I/O pins, if DIRS is set to the output state (which I can't recall whether it is a 1 or a 0 off the top of my head). Actually, the Stamp2 can only TRY to set the values to match OUTS, if something else is trying to make it something else, then it is a tug of war and the best man wins. With perhaps one of the battlers broken or wounded ;-)
Anyway, Output X sets bit X of DIRS to output status.
OUT1 is simply an alias for bit1 of OUTS. It is exactly the same as OUTS.bit1
Hope this helps.
Joe J.
|