I see... don't think my code analogy will work, but what you are after is reading the state of the "portB.sensor" input, where sensor is the bit #... right?