Pls Help on this: 8 binary inputs, 1 numeric output
merlin
Posts: 40
Hi all,
I have a device who informs the internal status setting 8 pins in 1 or 0, conforming a 8 bit code number, which should be converted into a single numeric value between 0 and 255.
So I have 3 questions here:
1.- How should be the correct sentence to read the 8 binary values, supposing we are connected 8 I/O ports of my BS2 to the device?
2.- How should be the correct routine to "translate" the 8 binary values into one single numeric value?
3.- How should be the workaround to save I/O ports in BS2 using some multiplexer to do the Input reading job?
Thanks in advance, best regards
merlin
I have a device who informs the internal status setting 8 pins in 1 or 0, conforming a 8 bit code number, which should be converted into a single numeric value between 0 and 255.
So I have 3 questions here:
1.- How should be the correct sentence to read the 8 binary values, supposing we are connected 8 I/O ports of my BS2 to the device?
2.- How should be the correct routine to "translate" the 8 binary values into one single numeric value?
3.- How should be the workaround to save I/O ports in BS2 using some multiplexer to do the Input reading job?
Thanks in advance, best regards
merlin
Comments
2. To see the value returned by INL, for instance, use something like "debug DEC INL" or "debug HEX INL". It's not a matter of translation; its just how its displayed.
3. There's a Nuts and Volts article on this on the Parallax site. Its listed as Column 109.
Cheers,