void shizhong_hanshu()
{
init();
Init_DS1302();
init_1602();
while(1)
{
if(du_k2==0)
dianzhicheng_hanshu();
tmpchange();
wendu_100bei=tmp();
show_date();
keyscan();
if((shi==clock_shi)&&(fen==clock_fen)&&(status==2)&&(miao<5))
{
clock_flag=1;
TR1=1;
}
if(status==1)
{
clock_flag=0;
clock=1;
TR1=0;
}
}
}
void get_pizhong()
{
uint j;
ulong hx711_dat;
for(j=0;j<5;j++)
Delay10ms();
hx711_dat=ReadCount();
temp=(uint)(hx711_dat/100);
}
void get_weight()
{
ulong hx711_data,a;
uint get,aa;
hx711_data=ReadCount();
get=(uint)(hx711_data/100);
if(get<(temp+4))
{
while(1)
{
if(du_k1==0)
shizhong_hanshu();
weight=0;
TR0=0;
chaozhong_flag=0;
clock=1;
if(leiji_flag==1)
{
weight_shuzhi(leiji_weight);
P3=0xf0;
if(P3!=0xf0)
{
leiji_count--;
break;
}
}
else
weight_shuzhi(weight);
hx711_data=ReadCount();
get=(uint)(hx711_data/100);
if(get>(temp+4))break;
}
}
a=ReadCount();
aa=(uint)(a/100)-temp;
weight=(uint)((float)aa/4.4+0.05);
weight=weight-qi_weight;
if(weight>=0)
{
if(weight>5000)
{chaozhong_flag=1;TR0=1;}
else
{chaozhong_flag=0;TR0=0;clock=1;}
weizhi_zifu(0x00,'+');
}
else {weizhi_zifu(0x00,'-');}
}
链接:https://pan.baidu.com/s/1ryRnKm1h8mNNi6sz2-MRaw 提取码:tvwu
|