请问谁有LCD1602滚屏显示的实例(包含程序和原理图),跪求共享,不甚感激涕零!!
请问谁有LCD1602滚屏显示的实例(包含程序和原理图),跪求共享,不甚感激涕零!! 1602中文资料里说的很清楚的啊。#include<reg51.h>
#define uchar unsigned char
uchar code table[]="I LOVE MCU";
sbit lcdrs=P2^5;
sbit lcdrw=P2^6;
sbit lcdE=P2^7;
sbit LE=P2^4;
uchar t;
void delay(int z)
{
int x,y;
for(x=z;x>0;x--)
for(y=120;y>0;y--);
}
void write_com(uchar com)
{
lcdrs=0;
lcdrw=0;
P0=com;
delay(10);
lcdE=1;
delay(10);
lcdE=0;
}
void write_data(uchar date)
{
lcdrs=1;
lcdrw=0;
P0=date;
delay(10);
lcdE=1;
delay(10);
lcdE=0;
}
void init(void)
{
lcdE=0;
write_com(0x38);
write_com(0x0c);
write_com(0x06);
write_com(0x14);
write_com(0x07);
}
void main()
{
LE=1;
init();
for(t=0;t<11;t++)
{
write_data(table);
delay(10);
}
while(1);
}
页:
[1]