Hi I am using the PIC18F4520 and have am trying to figure out how to use the push button. It is RB0 on the board. I looked through the posts and resources but couldn't find what I need.
So would the C code to initialize it be:
TRISB = 0x01;
and code to detect a press:
if (!PORTBbits.RB0)
/*do something*/
Debouncing is necessary, just want to check if this code is correct.
Thanks!
So would the C code to initialize it be:
TRISB = 0x01;
and code to detect a press:
if (!PORTBbits.RB0)
/*do something*/
Debouncing is necessary, just want to check if this code is correct.
Thanks!