I am just trying to turn on the LED when the button is pressed but the LED already remains on without a press button.
What am I doing wrong?
What am I doing wrong?
Rich (BB code):
Start:
bsf STATUS,RP0 ; select Register Page 1
bcf TRISC,0 ; make IO Pin C0 an output
bsf TRISA,RA3 ;make IO pin RA3 an input
bcf STATUS,RP0 ; back to Register Page 0
bcf PORTC,0
loop:
btfss PORTA,RA3
bsf PORTC,0 ; turn on LED C0 (DS1)
goto loop
end
Last edited: