|
您能幫我看看調(diào)試4.xx用這幾行代碼對嗎
void get_pizhong() //獲取皮重,秤盤重量
{
ulong hx711_dat;
hx711_dat=ReadCount(); //HX711AD轉(zhuǎn)換數(shù)據(jù)處理
temp=(uint)(hx711_dat/100);
}
void get_weight() //獲取被測物體重量
{
ulong hx711_data,a;
uint get,aa;
hx711_data=ReadCount(); //HX711AD轉(zhuǎn)換數(shù)據(jù)處理
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);
}
|
|