标题:
简单的LCD1602显示程序
[打印本页]
作者:
熊熊307112411
时间:
2019-4-18 17:10
标题:
简单的LCD1602显示程序
一个比较简单实用的LCD显示程序
0.png
(11.8 KB, 下载次数: 29)
下载附件
2019-4-18 22:37 上传
单片机源程序如下:
#include <reg51.h>
#include "mytype.h"
#include "lcd1602.h"
sbit KEY1 = P1^0;
sbit KEY2 = P1^1;
UINT8 temperature;
UINT8 code Str3[]=" Welcome ! ";
UINT8 code Str4[]=" Please wait ";
UINT8 Strtemperature[17] = {"temperature: "};
UINT8 Strhumidness[16] = " humidness:25\% ";
void HexToSTring(UINT8 hex, UINT8 *str)
{
str[12] = (hex/10)%10 + '0';
str[13] = hex%10 + '0';
str[14] = 0xdf;
str[15] = 'C';
}
void main()
{
Init_LCD();
Display_LCD_String(0x00, Str3);
Display_LCD_String(0x40, Str4);
delay(2000); //延时2s
temperature = 95;
Display_LCD_String(0x00, Strhumidness);
while(1)
{
if (KEY1 == 0)
{
delay(100);
if (KEY1 == 0)
{
while(!KEY1);
temperature++;
if (temperature == 100)
{
temperature = 0;
}
}
}
if (KEY2 == 0)
{
delay(100);
if (KEY2 == 0)
{
while(!KEY2);
if (temperature > 0)
……………………
…………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
液晶1602.rar
(67.65 KB, 下载次数: 91)
2019-4-18 17:10 上传
点击文件名下载附件
下载积分: 黑币 -5
作者:
榆林上校
时间:
2019-4-23 20:13
学习1602屏的好资料
作者:
1186486072
时间:
2019-4-24 19:43
好东西
作者:
whb040400
时间:
2020-2-25 21:28
十分感谢
作者:
coco爱编程
时间:
2020-3-27 14:26
请问有没有文本文档形式的程序,这个文件打不开
作者:
51hei团团
时间:
2020-3-27 14:29
coco爱编程 发表于 2020-3-27 14:26
请问有没有文本文档形式的程序,这个文件打不开
可以打开,我刚刚用最新版的winrar成功打开了,用记事本也成功的打开了源码
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1