antirez / antirez/bme680-pure-mp

Minor error in formula to calculate air pressure

Đang mở
#2 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
20
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I think I have found a very, very small error in the calculation of the air pressure. As far as I know, URL https://github.com/boschsensortec/BME68x_SensorAPI/ contains the reference API for handling data from a BME680 sensor. Line 871 in this driver reads:
` var2 = ((((var1 >> 2) * (var1 >> 2)) >> 11) * (int32_t)dev->calib.par_p6) >> 2;
`
In your driver this corresponds with line 69, which reads:
` var2 = (((var1 >> 2) ** 2) >> 11) * (self.par_p6 >> 2)`
I think it should read:
` var2 = ((((var1 >> 2) ** 2) >> 11) * self.par_p6) >> 2`

Running some tests show that the (absolute) difference between the air pressures calculated using both variants of the formula set is much less than 1 [hPa], thus much less than the typical accuracy. So normally, one will not notice the difference.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.