pjrebordao
Senior Member
I'm trying to detect an on/off switch on pin B.0 using the following code:
init:
input B.0
main:
if pinB.0 = 0 then
sertxd("L",13,10)
else
sertxd("H",13,10)
endif
pause 300
goto main
end
I have B.0 grounded with a 1K resistor. The switch closes the circuit from B.0 to 5V, through a 1K resistor.
Running the code above, always shows the pin as being High, right from the start. However if I use another pin (say B.3), the code and circuit behave as expected.
Any clues ?
init:
input B.0
main:
if pinB.0 = 0 then
sertxd("L",13,10)
else
sertxd("H",13,10)
endif
pause 300
goto main
end
I have B.0 grounded with a 1K resistor. The switch closes the circuit from B.0 to 5V, through a 1K resistor.
Running the code above, always shows the pin as being High, right from the start. However if I use another pin (say B.3), the code and circuit behave as expected.
Any clues ?