vead
Full Member level 5
Hello
I am using AT89c51 microcntroller and Keil compiler. when I build code I am getting error
Error Message
why I am getting this error. how to remove error ?
I am using AT89c51 microcntroller and Keil compiler. when I build code I am getting error
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 #include<reg51.h> #define LCDPORT P1 #define RS P2_0 #define RW P2_1 #define E P2_3 bit status=0 #define lcd_delay 60 void delay(unsigned int j) { unsigned int i,k; for(i=0;i<j;i++); for(k=0;k<100;k++); } void _lcd_init_write(unsigned char a) { RS = 0; RW = 0; LCDPORT=a; E=1; delay(lcd_delay); E=0; } void lcd_com(unsigned char a){ unsigned char temp; if(status){ status=0; goto a; } RS=0; a: RW=0; temp=a; temp&=0xF0; LCDPORT&=0x0F; LCDPORT|=temp; E=1; delay(lcd_delay); E=0; temp=a<<4; temp&=0xF0; LCDPORT&=0x0F; LCDPORT|=temp; E=1; delay(lcd_delay); E=0; } void lcd_data(unsigned char a){ status=1; RS=1; lcd_com(a); } void lcd_init(void){ delay(lcd_delay); _lcd_init_write(0x30); delay(lcd_delay); _lcd_init_write(0x30); delay(lcd_delay); _lcd_init_write(0x30); delay(lcd_delay); _lcd_init_write(0x20); delay(lcd_delay); lcd_com(0x28); delay(lcd_delay); lcd_com(4); delay(lcd_delay); lcd_com(0x85); delay(lcd_delay); lcd_com(6); delay(lcd_delay); lcd_com(1); delay(lcd_delay); } void lcd_puts(char *aaa) { unsigned int i=0; for(;aaa[i]!=0;i++)lcd_data(aaa[i]); }
Error Message
compiling display.c...
display.c(8): error C141: syntax error near 'void'
display.c(9): error C141: syntax error near '{'
display.c(11): error C141: syntax error near 'for'
display.c(11): error C141: syntax error near '=', expected ')'
display.c(11): error C129: missing ';' before '<'
display.c - 5 Error(s), 0 Warning(s).
why I am getting this error. how to remove error ?