I have connected a push-switch to a PortA.5 on PIC16F876A.But it's not responding.Here is the code:
DOWN VAR PORTA.5
if DOWN=0 Then
IF SETBAND = 1 THEN
SETHEAT=SETHEAT-1
write 1,setheat
ELSE
SETCOOL=SETCOOL-1
WRITE 2,SETCOOL
ENDIF
endif
I have connected a push-switch to a PortA.5 on PIC16F876A.But it's not responding.Here is the code:
DOWN VAR PORTA.5
if DOWN=0 Then
IF SETBAND = 1 THEN
SETHEAT=SETHEAT-1
write 1,setheat
ELSE
SETCOOL=SETCOOL-1
WRITE 2,SETCOOL
ENDIF
endif
Do you have portA configured as digital? do you have a pullup/pulldown resistor on your input pin?
Regards
CharlieM
Using PBP3
MCSPX
Dave
Always wear safety glasses while programming.
Bookmarks