【文件属性】:
文件名称:电子秤程序
文件大小:19KB
文件格式:C
更新时间:2018-09-26 06:10:10
电子秤
#include
#define uint unsigned int
#define uchar unsigned char
uchar code table[]="123.4560789 c-q+";
uchar code table1[]={0xfe,0xfd,0xfb,0xf7};
sbit lcdrs=P2^6;
sbit lcdwr=P2^5;
sbit lcden=P2^7;
uchar num;
void delay(uint z)
{ uchar x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void write_com(uchar com) //1602写命令
{
lcdrs=0;
P0=com;
delay(5);
lcden=1;
delay(5);
lcden=0;
}