How to assign only 3 of 4 pins for OUTC to a variable....
cthomas
Posts: 17
Here is what I'm doing, and it works fine....
.
thumbselect VAR OUTC 'includes I/O 8, 9, 10, and 11 as output pins. 11 is for an edge or face state, 8, 9, and 10 decode which thumbwheel to read
.
.
FOR idx = 0 TO 7
thumbselect = idx 'Assigns idx value to Nib OUTC thus setting up which thumbwheel to read
Digit(idx) = INB 'Stores the current value of the thumbwheel at Digit(idx) and will fill the Digit array with the starting values of all thumbwheels
NEXT
.
.
What I'd like to do instead is assign only I/O pins 8, 9, and 10 to thumbselect....leaving I/0 pin 11 available for other use.
I was trying to use pin 11 for something else, forgetting that it is periodically forced low by the above FOR NEXT loop. I'm out of pins and can't move to a larger Stamp. Any thoughts or suggestions received with gratitude.
Thanks.
.
thumbselect VAR OUTC 'includes I/O 8, 9, 10, and 11 as output pins. 11 is for an edge or face state, 8, 9, and 10 decode which thumbwheel to read
.
.
FOR idx = 0 TO 7
thumbselect = idx 'Assigns idx value to Nib OUTC thus setting up which thumbwheel to read
Digit(idx) = INB 'Stores the current value of the thumbwheel at Digit(idx) and will fill the Digit array with the starting values of all thumbwheels
NEXT
.
.
What I'd like to do instead is assign only I/O pins 8, 9, and 10 to thumbselect....leaving I/0 pin 11 available for other use.
I was trying to use pin 11 for something else, forgetting that it is periodically forced low by the above FOR NEXT loop. I'm out of pins and can't move to a larger Stamp. Any thoughts or suggestions received with gratitude.
Thanks.
Comments
If you need I/O 11 as an output, this scheme won't work. You'll have to assign values individually to OUT8, OUT9, and OUT10. This might look like:
OUT8 = idx.bit0
OUT9 = idx.bit1
OUT10 = idx.bit2
Another idea, if bit11 is a bit variable used for I/O 11, you could do:
OUTC = (bit11<<3) + idx
This always keeps I/O 11 current when you change I/O 8-11
Works perfectly.