您能帮我看看调试4.xx用这几行代码对吗
void get_pizhong() //获取皮重,秤盘重量
{
ulong hx711_dat;
hx711_dat=ReadCount(); //HX711AD转换数据处理
temp=(uint)(hx711_dat/100);
}
void get_weight() //获取被测物体重量
{
ulong hx711_data,a;
uint get,aa;
hx711_data=ReadCount(); //HX711AD转换数据处理
get=(uint)(hx711_data/100);
if(get>temp)
{
a=ReadCount();
aa=(uint)(a/100)-temp;
weight=(uint)((float)aa/4.00+0.05);
}
}
void Display_Weight()
{
LcdWriteCom(0x80);
LcdWriteData(weight/1000 + 0x30);
//LcdWriteData('.');
LcdWriteData(weight%1000/100 + 0x30);
LcdWriteData(weight%100/10 + 0x30);
LcdWriteData(weight%10 + 0x30);
}
|