附 录
附录二 程序清单
#include<reg51.h>
#include<intrins.h>
#define Y P0
sbit TX=P2^0;
sbit RX=P2^1;
sbit A2=P2^2;
sbit A1=P2^3;
sbit A0=P2^4;
sbit but0=P3^1;
sbit but1=P3^0;
sbit but2=P3^4;
sbit but3=P3^5;
sbit buzz=P3^7;
int s,min,i,j;
int g[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67};
int dis[4]={0x3f,0x3f,0x3f,0x3f} ;
int z,x,c,k,minx;
void remind(int k,int minx);
void Delay();
void tmin()//设定提醒距离
{
if(but0==0)
{
Delay();
if(but0==0)
z++;
if(z>4)
z=0;
dis[0]=g[z];
while(but0==0)
Delay();
}
if(but1==0)
{
Delay();
if(but1==0)
x++;
if(x>9)
x=0;
dis[1]=g[x];
青山遮不住while(but1==0)
Delay();个人简历网
}
if(but2==0)
{
Delay();
if(but2==0)
c++;
if(c>9)
c=0;
dis[2]=g[c];
while(but2==0)
Delay();
}
min=z*1000+x*100+c*10;
remind(s,min);
if(TF0==1||s>4000)
{
dis[0]=0x79;
dis[1]=0x77;
dis[2]=0x77;
dis[3]=0x3f;
苹果手机怎么下载手机铃声}
el
{
hunp=s%10000/1000;
deca=s%1000/100;
theunit=s%100/10;
deci=s%10/1;菠萝蜜的英文
dis[3]=g[deci];
dis[2]=g[theunit]+0x80;
dis[1]=g[deca];
dis[0]=g[hunp];
}
}
void remind(int k,int minx) //蜂鸣器发声提示还有问题
{
int t;
if(k<minx)
{
TR1=1;
if(TF1==1)
{
t++;
TR1=0;TF1=0;TH1=0;TL1=0;
if(t>1000)
{
buzz=1;
摩诃般若波罗蜜经
Delay();
buzz=0;
void Delay()//延时
漫怎么组词{
静夜思原文int m,n;
for(m=30;m>0;m--)
{for(n=100;n>0;n--);}
}
void main()//主程序
{
unsigned int mod=0;
for(i=0;i<4;i++)
dis[i]=0x3f;
while(1)
{
if(but3==0)
{
Delay();
if(but3==0)
mod=~mod;
z=0;x=0;c=0;
for(i=0;i<4;i++)
肉饼怎么做dis[i]=0x3f;
while(but3==0)
Delay();
}
if(mod==0)
tmin();
el
ranging();
display();
}
}