Warm tip: This article is reproduced from serverfault.com, please click

NodeMCU Lua bme280: float values on integer build?

发布于 2020-11-29 20:35:06

How can I get float values from a BME280 on a integer build using the BME280 Lua module with bme280_math?

Using the deprecated bme280 c-Module, for instance, temperature values were: temperature in °C * 100, getting float values was like:

tempFloat = tostring(temp/100).."."..temp%100

Now, with bme280 Lua module and bme280_math, the temperature is returned in °C, so on an integer build readings are now "24" instead of "24378". How to get "24378" again?

Questioner
Michi
Viewed
0
Michi 2020-12-23 00:06:24

The bme280 lua module used on an integer build will return integer values with 1°C resolution only.