forked from apachiww/hd44780_for_sdcc_51
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_lcd2004.c
31 lines (30 loc) · 817 Bytes
/
main_lcd2004.c
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
#include "delay.h"
#include "hd44780_i2cbus.h"
void main(void)
{
lcdinit(
LCD1602_4BITMODE | LCD1602_2LINE | LCD1602_5x8DOTS,
LCD1602_DISPLAYON | LCD1602_CURSOROFF | LCD1602_BLINKOFF,
LCD1602_ENTRYLEFT | LCD1602_ENTRYSHIFTDEC,
LCD1602_BACKLIGHT
);
while(1)
{
lcdwritestring("ABCDEFGHIJKLMNOPQRST");
lcdsetcursor(0, 1);
lcdwritestring("UVXWYZabcdefghijklmn");
delay_ms(2000);
lcdsetcursor(0, 2);
lcdwritestring("opqrstuvxwyz12345678");
lcdsetcursor(0, 3);
lcdwritestring("90.,-><+/@&!%'[]{}_|");
delay_ms(2000);
lcdclear();
for(unsigned int i = 0; i<20; i++)
{
lcdwrite('.');
delay_ms(250);
}
lcdclear();
}
}