BMP280 example code produces text as opposed to numbers for the temperature and barometric pressure, which just requires additional downstream manipulation to be able to be used in graphing packages (like Kibana).
Unless there’s a compelling reason not to, would make it a bit easier for new users to just convert into human readable numbers in the first place instead of splitting into integer and decimal placings.
Seems that most other example codes just use numbers.
BME 280:
@property
def values(self):
""" human readable values """
t, p, h = self.read_compensated_data()
p = p // 256
pi = p // 100
pd = p - pi * 100
hi = h // 1024
hd = h * 100 // 1024 - hi * 100
return ("{}".format(t / 100), "{}.{:02d}".format(pi, pd),
"{}.{:02d}".format(hi, hd))
BMP 280:
@property
def values(self):
""" human readable values """
t, p, h = self.read_compensated_data()
p = p // 256
pi = p // 100
pd = p - pi * 100
hi = h // 1024
hd = h * 100 // 1024 - hi * 100
return ("{}".format(t / 100), "{}.{:02d}".format(pi, pd),
"{}.{:02d}".format(hi, hd))
BMP280 example code produces text as opposed to numbers for the temperature and barometric pressure, which just requires additional downstream manipulation to be able to be used in graphing packages (like Kibana).
Unless there’s a compelling reason not to, would make it a bit easier for new users to just convert into human readable numbers in the first place instead of splitting into integer and decimal placings.
Seems that most other example codes just use numbers.
BME 280:
BMP 280: