What do you get with something like this?
Your code as-is will never clear PORTB.0 to indicate PORTA.0 is at ground.Code:TRISA = %00000011 TRISB = %00000000 loop1: if PORTA.0 = 1 then PORTB.0 = 1 else PORTB.0 = 0 endif high PORTB.1 goto loop1 end
You could even simplify this with PORTB.0 = PORTA.0 to reflect the logic
input on RA0 to RB0.. or the inverse with PORTB.0 = ~PORTA.0.




Bookmarks