给你一个我用过的吧
unsigned long HX711_Read(void)
{
unsigned long count;
unsigned char i;
HX711_DOUT=1;
_nop_();
_nop_();
HX711_SCK=0;
count=0;
EA = 1;
while(HX711_DOUT);
EA = 0;
for(i=0;i<24;i++)
{
HX711_SCK=1;
count=count<<1;
HX711_SCK=0;
if(HX711_DOUT)
count++;
}
HX711_SCK=1;
count=count^0x800000;
_nop_();
_nop_();
HX711_SCK=0;
return(count);
}
时段 | 个数 |
---|---|
{{f.startingTime}}点 - {{f.endTime}}点 | {{f.fileCount}} |