标题:
求下面一段函数单个HX711模块程序读weight拓展成四个HX711模块采集数据
[打印本页]
作者:
时光碎片
时间:
2015-3-30 21:25
标题:
求下面一段函数单个HX711模块程序读weight拓展成四个HX711模块采集数据
Get_maopi()
{
weight_maopi=Read_count();
}
Get_weight(
{
weight_shiwu=Readcount(); //Readcount()为HX711的驱动,及读出的数据
weight_shiwu=weight_shiwu-Get_maopi();
Weight_shiwu=Weight_shiwu/((unsigned int)(float)GapValue);
... ....//求上面一段函数单个HX711模块读weight拓展成四个HX711模块采集数据,相加后的的结果
求程序,感激不尽..
ulong Readcount(void) //增益128
{
ulong count;
uchar i;
hx711_dout=1;
Delay__hx711_us();
hx711_sck=0;
count=0;
while(hx711_dout);
for(i=0;i<24;i++)
{
hx711_sck=1;
count=count<<1;
hx711_sck=0;
if(hx711_dout)
count++;
}
hx711_sck=1;
Delay__hx711_us();
hx711_sck=0;
return(count);
}
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1