#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
#define dataport P0
sbit rs=P2^0;
sbit rw=P2^1;
sbit en =P2^2;
sbit sp =P1^0;
uchar code dis1[] = {"welcome!"};
uchar code dis2[] = {"I LOVE MCU"};
uchar code table[] = {0x08,0x0f,0x12,0x0f,0x0a,0x1f,0x02,0x02};
void delay(uint z)
{
uint m,n;
for(m=z;m>0;m--)
for(n=112;n>0;n--);
}
BF_busy()
{ dataport=0x00; // 测试LCD忙碌状?
rs = 0;
rw = 1;
while(dataport&0x80);
en = 1;
delay(6);
en= 0;
}
void dic_wr(unsigned char dicate)
{
BF_busy();
rs=0;
rw=0;
delay(6);
dataport=dicate;
en=1;
delay(6);
en=0;
}
void date_wr(unsigned char dat)
{
BF_busy();
rs=1;
rw=0;
dataport=dat;
en=1;
delay(6);
en=0;
}
void LCD_init(void)
{
//delay(10);
dic_wr(0x38);
delay(10);
dic_wr(0x38);
delay(10);
dic_wr(0x38);
delay(10);
dic_wr(0x08);
delay(10);
dic_wr(0x01);
delay(10);
dic_wr(0x06);
//delay(10);
dic_wr(0x0c);
//清除LCD的显示内容
}
void main()
{
uchar a;
a=0;
sp=0;
LCD_init();
dic_wr(0x00);
while(a!=8)
{
date_wr(table[a]);
a++;
}
while(1);
}
单片机 液晶LM016l 高手帮我看看 为什么显示不出汉字?
LM016i这是5X7点阵型液晶,只能显示ASCII字符(数字和字母),不能显示汉字!简单说,就就是大家知道的1602液晶……
利用AT89C51单片机,LM016L液晶显示、时钟芯片DS1302芯片制作电子钟,需 ...
lm016l没有卖的,跟1602一样,proteus仿真时用它来代替1602,告诉你如果你是作业,连写这么简单程序的耐心都没有,你还不如不去交作业,电路图放了,程序只给一部分,供参考,头文件自己去写 include<reg52.h> include"lcd1602.h"include"ds1302.h"uchar readaddress[7]={0x8d,0x8b,0x89,0x87...
利用AT89C51单片机,LM016L液晶显示、时钟芯片DS1302芯片制作电子钟,需 ...
1); \/\/关闭显示WriteCommandLCM(0x01,1); \/\/显示清屏WriteCommandLCM(0x06,1); \/\/ 显示光标移动设置WriteCommandLCM(0x0C,1); \/\/ 显示开及光标设置}\/\/按指定位置显示一个字符void DisplayOneChar(unsigned char X,