Difference between revisions of "Interfacing LCD with Starter AVR"
Line 4: | Line 4: | ||
=Code= | =Code= | ||
=LCD 16x1= | =LCD 16x1= | ||
+ | <syntaxhighlight> | ||
+ | #include "lcd.h" | ||
+ | int main() | ||
+ | { | ||
+ | /*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTC.4 to PORTC.7*/ | ||
+ | LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PC_4,PC_5,PC_6,PC_7); | ||
+ | LCD_Init(1,16); | ||
+ | LCD_DisplayString("Explore"); | ||
+ | while(1); | ||
+ | return (0); | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
=LCD 16x2= | =LCD 16x2= | ||
=LCD 20x4= | =LCD 20x4= | ||
=Demo= | =Demo= | ||
=Downloads= | =Downloads= |
Revision as of 11:15, 2 April 2016
Basic
Hookup
Code
LCD 16x1
#include "lcd.h" int main() { /*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTC.4 to PORTC.7*/ LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PC_4,PC_5,PC_6,PC_7); LCD_Init(1,16); LCD_DisplayString("Explore"); while(1); return (0); }