标题:
为什么LCD1602仿真无显示,且P0.5端口有问题,新手求解决方式?
[打印本页]
作者:
IJLG
时间:
2020-3-24 13:30
标题:
为什么LCD1602仿真无显示,且P0.5端口有问题,新手求解决方式?
图片1.png
(5.14 MB, 下载次数: 37)
下载附件
2020-3-24 13:27 上传
#define LCD_DB P0
sbit LCD_E=P2^0;
sbit LCD_RW=P2^1;
sbit LCD_RS=P2^2;
u8 disp[]=" dripping speed ";
void LCD_init()
{
LCD_write_command(0x38);
LCD_write_command(0x0c);
LCD_write_command(0x06);
LCD_write_command(0x01);
LCD_write_command(0x80);
}
void LCD_write_command(unsigned char com)
{
LCD_E=0;
LCD_RS=0;
LCD
_RW=0;
LCD_DB=com;
delay(1000);
LCD_E=1;
delay(5000)
LCD_E=0;
}
void LCD_write_data(unsigned char dat)
{
LCD_E=0;
LCD_RS=1;
LCD_RW=0;
LCD_DB=dat
delay(1000);
LCD_E=1
delay(5000)
LCD_E=0;
}
void main()
{
u8 i;
LCD_init();
for(i=0;i<16;i++)
{
LCD_write_data(disp
);
}
while(1);
}
作者:
xxpp2011
时间:
2020-3-24 16:03
P0口接上拉电阻
作者:
华夏哈哈哈
时间:
2020-3-24 18:08
需要数据指针,你的主程序没有数据指针,不是初始化以后就直接写入的
作者:
IJLG
时间:
2020-3-24 18:37
xxpp2011 发表于 2020-3-24 16:03
P0口接上拉电阻
感谢
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1