Digital I-O Board in Serial Mode Byte back to individual Bit
T-town
Posts: 17
I've been messing around with my Parallax Digital I-O board model 27113 http://www.parallax.com/product/27113 using the serial interface. I am using the Parallax sample code they provided. Can someone give me an example of how to take the "optos" byte sent from the inputs (in the sample code) and convert that into 8 individual bits that represent each input? Ditto for the "index" byte to the outputs. Ive been able to read a single input and force an output but only using the octal number (If optos = 1 then
.2, 4, 8
.). Im thinking there has to be an easy way to convert the 255 combinations back to 8 bits I can use in code. Keeping the explanation simple would be appreciated. Im pretty new to this. Thanks as always. Joe
Comments
optos.BIT0 ' this is the first bit
optos.BIT1 ' this is the second bit
optos.BIT7 ' this is the last bit
Same goes for index.