WS #1

Merged
sundp merged 28 commits from WS into master 2024-10-11 20:50:58 +08:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit f6a5efe8fa - Show all commits

View File

@ -73,7 +73,7 @@ uint8_t Flag_Error = 0;
//#define GapValue 903.2 // for 1kg bar
//#define GapValue 106.5 // for 20kg bar
//#define GapValue 101.5 // for 20kg bar
#define GapValue 99.0 // for 20kg bar
#define GapValue 99.08 // for 20kg bar
void HX711_Init(void)
{
@ -151,7 +151,7 @@ uint32_t HX711_Read(void) //增益128
void Get_GrossWeight(void)
{
gross_weight = HX711_Read();
gross_weight = KalmanFilter(gross_weight);
//gross_weight = KalmanFilter(gross_weight);
//APP_LOG(TS_OFF, VLEVEL_M, "\r\n ##### Gross Weight =%d <<<<<< \r\n",gross_weight);
}
@ -167,7 +167,7 @@ void Get_NetWeight(void)
net_weight = HX711_Buffer;
net_weight = net_weight - gross_weight; //获取实物的AD采样数值。
net_weight = (int32_t)((float)net_weight/GapValue); //计算实物的实际重量
net_weight = (int32_t)((float)net_weight/(float)GapValue); //计算实物的实际重量
//因为不同的传感器特性曲线不一样因此每一个传感器需要矫正这里的GapValue这个除数。
//当发现测试出来的重量偏大时,增加该数值。