//显示取模

[复制链接]
 楼主| 34af9uc 发表于 2023-6-24 20:49 | 显示全部楼层 |阅读模式
void                xianshi_qumo()                //显示取模
{
int qumo_a1;
if((wendu_a2 <-20)||(wendu_a2 >120))                //没插温度传感(显示---)
{
xs_a1                =biao[17];
xs_a2                =biao[17];
xs_a3                =biao[17];
return;
}
if(wendu_a2 <0)                        //零度以下
{
qumo_a1                =wendu_a2;                //负数变正数(取反加1)
qumo_a1                =~qumo_a1;                //取反
qumo_a1                +=1;                        //加1
xs_a1                =biao[17];                                //-负号零下
xs_a2                =biao[qumo_a1/10];
xs_a3                =biao[qumo_a1%10];
return;
}

if(wendu_a2 <100)                //100以下(00.0)
{
qumo_a1                =wendu_a2;
xs_a1                =biao[qumo_a1/10];
xs_a2                =biao[qumo_a1%10];
xs_a2                |=0B10000000;                //小数点点亮
xs_a3                =biao[wendu_a3];
return;
}

if(wendu_a2 <201)                //200以下
{
qumo_a1                =wendu_a2;
xs_a1                =biao[qumo_a1/100];
xs_a2                =biao[(qumo_a1%100)/10];
xs_a3                =biao[(qumo_a1%100)%10];
return;
}
/*if(wendu_a2 >200)                //传感器短路(显示---)
{
xs_a1                =biao1[0];
xs_a2                =biao1[0];
xs_a3                =biao1[0];
return;
}*/
}

319

主题

487

帖子

63

粉丝
快速回复 在线客服 返回列表 返回顶部