debby
Newbie level 3
Hi all...
To interface a 16x2 LCD to ATmega8 and program d chip im using CODEVISION AVR, i hav written d foll. code to initialise the lcd, however there's a declaration error in st.4 and 5... Please help me rectify it.. also wat is d need for st. 7
1 #include <mega8.h>
2 #include <lcd.h>
3 #include <delay.h>
4 void LCDbyte(uint8_t,uint8_t)
5 #define LCDcmd(c) (LCDbyte(c,0))
6 #define LCDcmd(d) (LCDbyte(d,1))
7 LCDcmd(0x30); //func set:8 bit interface
8 delay_ms(20);
9 LCDcmd(0x30); //func set:8 bit interface
10 delay_ms(20);
11 LCDcmd(0x30); //func set:8 bit interface
12 delay_ms(20);
13 LCDcmd(0x28); //func set:4 bit
14 LCDcmd(0x01); //clear cmd
15 LCDcmd(0x06); //set entry mode cmd
void main()
{
lcd_putsf("hello");
}
while (1);
}
MOD: What language is this? Nobody can understand your English.
To interface a 16x2 LCD to ATmega8 and program d chip im using CODEVISION AVR, i hav written d foll. code to initialise the lcd, however there's a declaration error in st.4 and 5... Please help me rectify it.. also wat is d need for st. 7
1 #include <mega8.h>
2 #include <lcd.h>
3 #include <delay.h>
4 void LCDbyte(uint8_t,uint8_t)
5 #define LCDcmd(c) (LCDbyte(c,0))
6 #define LCDcmd(d) (LCDbyte(d,1))
7 LCDcmd(0x30); //func set:8 bit interface
8 delay_ms(20);
9 LCDcmd(0x30); //func set:8 bit interface
10 delay_ms(20);
11 LCDcmd(0x30); //func set:8 bit interface
12 delay_ms(20);
13 LCDcmd(0x28); //func set:4 bit
14 LCDcmd(0x01); //clear cmd
15 LCDcmd(0x06); //set entry mode cmd
void main()
{
lcd_putsf("hello");
}
while (1);
}
MOD: What language is this? Nobody can understand your English.