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
http://www.picbasic.co.uk/forum/showthread.php?t=561
Hi, we are pleased to see that you are using our forum.
We'd like you to become a member of our community. Membership is FREE, please REGISTER and view our forums without these annoying reminders!
Once registered you may post on the forums, download from the file areas and use the WIKI without interruption.
Bookmarks