The variable name will not matter. What I need to be is be able to step through portb.0 to portb.4 which works fine just using 0 to 4. The problem is that when "sensor" is equal to 0 the if then statement thinks that sensor is 0 and not 1 even though the port is being pulled high. As such when I do it for 2,3 and 4 the same thing. It looks at the number and not the state of the port.
Bookmarks