Hi there,
I'm struggling a bit with testing the status of PortB pin of a Pic16F876A.
I want to be able to read the state of one of the pins of PORTB based upon a variable.
-----------------------------------
DEFINE LOADER_USED 1
DEFINE OSC 10
Green var PORTA.0 ' Led 2
Data_1 var byte
ADCON1=$07
TRISB=%00000000
Init:
high green
pause 2000
low green
data_1 = 5
test:
if PortB.0(data_1) = 0 then
--> LCD should show "Low"
else
--> LCD should show "high
endif
pause 2000
goto test
------------------------------
When I use 'Data_1' as a variable with PortB it doesn't seem to work.
Is there a solution or workaround for this?
Data_1 can be from 0 to 7.
Thanks
Bookmarks