原料说明
keli4和KR-51单片机开发板和stc烧录工具
不多说,直接上代码。
#include "reg52.h"
#define uchar unsigned char
#define uint unsigned int
sbit rs=P2^0;//H数据,L命令
sbit lcden=P2^2;//高脉冲使能,使能脉宽最小150ns
sbit rw=P2^1;
uchar code table[]= "welcome to use";
uchar code table1[]="press the key";
uchar code table3[]="Time remaining";
sbit key1=P3^2;
sbit key2=P3^3;
sbit key3=P3^4;
sbit key4=P3^5;
uchar qian;
uchar bai