C - Error: expected a ")"

I have written code in C, but it gives a particularly strange error message:

lcd.c(618): error: #18: expected a ")" if(character_segment_data & (0b10000000>>width_counter))

Code:

void lcd_putchar(char character,int forground_color,char background_color_activation,int background_color)
{
int temporary_color;
unsigned char width_counter,length_counter;
char character_segment_data;
for(length_counter=0;length_counter<16;length_counter++)
{ character_segment_data=font8x16[character-0x20][length_counter]; for(width_counter=0;width_counter<8;width_counter++) { if(character_segment_data & (0b10000000>>width_counter))//line 618-origion of error lcd_write_pixel(((int)x_text*8)+width_counter,((int)y_text*16)+length_counter,forground_color); else { if(background_color_activation) { temporary_color=lcd_read_rdr(); temporary_color=lcd_read_rdr(); lcd_write_wdr(temporary_color); } else lcd_write_pixel(((int)x_text*8)+width_counter,((int)y_text*16)+length_counter,background_color); } }
}
if(++x_text>40)
{ x_text=0; if(++y_text>15) y_text=0;
}
}

This line if(character_segment_data & (0b10000000>>width_counter)) generated the error. What is the origin of the error and how can I resolve it?

Thank you.

10 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like