Microcontroller › PIC › Novice at Microcontrollers › Hi Ren, while (1){
November 24, 2012 at 5:57 pm
#8788
AJISH ALFRED
Participant
Hi Ren,
while (1)
{
if (PORTBbits.RB4=1) //THIS IS NOT A CONDITIO, BUT AN ASSIGNMENT STATEMENT
(PORTC=0xff);
}
The correct coding is,
while (1)
{
if (PORTBbits.RB4==1) //SEE THE LOGICAL OPERATOR “==”
(PORTC=0xff);
}
You should practice more C coding and I hope you won’t do these kind of silly mistakes again