this code is not working,when pressing RB0 RB4 should flash ,RB1 RB5 should flash ,
RB2 RB6 should flash ,RB3 RB7 should flash ,
but nothing isn't working
code:
#include <pic18.h>
#include <config.h>
#include <delay.h>
main(void){
TRISB = 0x0F; //RB4,RB5,RB6 and RB7 are outputs, others inputs
RB4 = 0; // turn LED off
RB5 = 0; // turn LED off
RB6 = 0; // turn LED off
RB7 = 0; // turn LED off
while(1)
{
//if((RB0=1) & (RB1=1) & (RB2=1) & (RB3=1))
//DelayMs(30);
if(!RB0) RB4=1;
else if(!RB1) RB5=1;
else if(!RB2) RB6=1;
else if(!RB3) RB7=1;
//if(!(RB0 & RB1 & RB2 & RB3))
//DelayMs(30);
else
RB4 = 0;
RB5 = 0;
RB6 = 0;
RB7 = 0;
}
}