Write output pins as byte
Revave
Posts: 2
Hello,
I am new with the basic stamp. I have a question about writing outputs.
I would like to copy a variable with datatype byte to output pins 8 -15. (BS2pe)
For example:
Value VAR Byte
If Value is dec 3, pin 8 and 9 should be high.
If Value is dec 10, pin 9 and 11 should be high.
This up to 255 (8 output pins needed)
Is there a simple command available to copy the VAR to OUTH (pin 8 to 15)?
I've tried the next command, but it doesn't work.
OUTH = Value
Best regards,
Reijnko
I am new with the basic stamp. I have a question about writing outputs.
I would like to copy a variable with datatype byte to output pins 8 -15. (BS2pe)
For example:
Value VAR Byte
If Value is dec 3, pin 8 and 9 should be high.
If Value is dec 10, pin 9 and 11 should be high.
This up to 255 (8 output pins needed)
Is there a simple command available to copy the VAR to OUTH (pin 8 to 15)?
I've tried the next command, but it doesn't work.
OUTH = Value
Best regards,
Reijnko
Comments
http://forums.parallax.com/showthread.php?129932-Penguin-Robot-Math-Punctuation-%28REVB%29
Try this example:
value = %11000110
I've found a solution:
Value=128
DIRS=%1111111100000000
OUTH Value
The word name is INS.
The nibble names are INA, INB, INC, IND
and the bit names are IN0 - IN7 and IN8 - IN15.
value VAR Byte
value.BIT1 = 0
Remember, this way can only be done BS2 and above
At my age and level of sleep deprivation ???