This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:iot-open:practical:hardware:sut:stm32:emb1b_1 [2024/04/21 08:31] – [Start] ktokarz | en:iot-open:practical:hardware:sut:stm32:emb1b_1 [2024/04/21 09:41] (current) – [FAQ] ktokarz | ||
---|---|---|---|
Line 38: | Line 38: | ||
==== Steps ==== | ==== Steps ==== | ||
- | The steps below present only interaction with the sensor. Those steps should be supplied to present the data (or send it over the network) using other scenarios accordingly, | + | The steps below present only interaction with the sensor. Those steps should be supplied to present the data (or send it over the network) using other scenarios accordingly, |
=== Step 1 === | === Step 1 === | ||
Line 76: | Line 76: | ||
The temperature is Celsius, air pressure is in Pascals (so we divide it by float 100 to obtain the hPa reading), and relative air humidity is in % (frequently referenced as %Rh). | The temperature is Celsius, air pressure is in Pascals (so we divide it by float 100 to obtain the hPa reading), and relative air humidity is in % (frequently referenced as %Rh). | ||
- | Note that the controller class has an exciting function of trading | + | Note that the controller class has an exciting function of trading |
<code c> | <code c> | ||
float altitude = bme280.readAltitude(1013.00F); | float altitude = bme280.readAltitude(1013.00F); | ||
</ | </ | ||
- | You need to know the sea level pressure (a parameter, here, 1013hPa). It uses '' | + | Note that due to the non-linear characteristics of the air pressure drop with increasing altitude, it does not work correctly at high altitudes. |
The library also has a mathematical calculation function that returns current sea level pressure if only altitude and local air pressure are known. It does not read the sensor itself, however: | The library also has a mathematical calculation function that returns current sea level pressure if only altitude and local air pressure are known. It does not read the sensor itself, however: | ||
Line 92: | Line 92: | ||
===== FAQ ===== | ===== FAQ ===== | ||
- | **I've got NaN (Not a Number) readings. What to do?**: Check if GPIO is OK (should be 47), check if you initialised controller class and most of all, give the sensor some recovery time (at least 250ms) between consecutive readings. | + | **I've got NaN (Not a Number) readings. What to do?**: Check if the I2C address corresponds to the BME280 sensor |
<WRAP noprint> | <WRAP noprint> |