I'm reading some data from a parallel port and getting the data in hex (or binary) format. I need to find the '0' bit in this binary sequence and map it to a number. The picture clears up the issue.
http://img266.imageshack.us/img266/4326/keypadqa7.jpg
B7-B4: Outputs that are written to the parallel port. When B7=0, the inputs (B3-B0) would be scanned to find a zero. For example,If the zero was found B3, the code should return #1 the node number. This sequence would be infinite. The idea is the same as the keypad matrix implemented in some microprocessors.
I have no problem writing and reading the parallel port, the problem is how to search for the zero bit from B3-B0. After that I need to map it to a node (interaction) number.
Any suggestions or help would be truly appreciated. Thanks