基于51单片机家具门屉耐用性自动检测装置程序设计
#define uint unsigned int
#define uchar unsigned char
#define ZKB 6
#define max_time 100
sbit gd1=P1^0;
sbit gd2=P1^1;
sbit en=P1^2;
sbit zx=P1^3;
sbit clock=P1^4;
sbit lcdrs=P2^3;
sbit lcdrw=P2^4;
sbit lcden=P2^5;
uchar k=0;
uchar j=0;
uchar flag=0;
uint
uchar num;
uint zheng=0,fan=0;
uint shijian[51];
uchar code table2[]="forward:
uchar code table3[]="backward:
uchar code table4[]="
void timer_init()
{
}
uint data_pro(void)
{
}
void delay_50us(uint t)
{
uint y;
for(;t>0;t--)
for(y=19;y>0;y--);
}
void write_com(uchar com)
{
lcdrs=0;
lcdrw=0;
lcden=0;
P0=com;
delay_50us(10);
lcden=1;
delay_50us(20);
lcden=0;
}
void write_data(uchar date)
{
lcden=0;
lcdrs=1;
lcdrw=0;
P0=date;
delay_50us(10);
lcden=1;
delay_50us(20);
lcden=0;
}
void init()
{
write_com(0x38);
delay_50us(100);
delay_50us(100);
write_com(0x06);
delay_50us(100);
delay_50us(100);
}
void write_zheng(uchar add,uchar date)
{
uchar qian,bai,shi,ge;
qian=date/1000;
bai=date00/100;
shi=date0/10;
ge=date;
write_com(0x80+add);
write_data(0x30+qian);
write_data(0x30+bai);
write_data(0x30+shi);
write_data(0x30+ge);
}
void write_fan(uchar add,uchar date)
{
uchar qian,bai,shi,ge;
qian=date/1000;
bai=date00/100;
shi=date0/10;
ge=date;
write_com(0x80+0x40+add);
write_data(0x30+qian);
write_data(0x30+bai);
write_data(0x30+shi);
write_data(0x30+ge);
}
void main()
{
}
avr_time=data_pro();
write_zheng(12,zheng); //显示修改后,正转次数
}
{
51单片机家具门屉耐用性自动检测装 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)