Modifications

Sauter à la navigation Sauter à la recherche
615 octets ajoutés ,  26 février 2022 à 22:40
Ligne 91 : Ligne 91 :     
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
x
+
from machine import I2C
 +
# BME280 aslo work for BMP280
 +
from bme280 import BME280, BMP280_I2CADDR
 +
from time import sleep
 +
i2c = I2C(1)
 +
bmp = BME280( i2c=i2c, address=BMP280_I2CADDR )
 +
while True:
 +
    # returns a tuple with (temperature, pressure_hPa, humidity)
 +
    print( bmp.raw_values )
 +
    sleep(1)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
Which produce the following results:
 +
 +
<syntaxhighlight lang="bash">
 +
(22.28, 1017.68, 0.0)
 +
(22.27, 1017.66, 0.0)
 +
(21.87, 1017.67, 0.0)
 +
(21.83, 1017.73, 0.0)
 +
(21.83, 1017.68, 0.0)
 +
(21.81, 1017.68, 0.0)
 +
(21.81, 1017.68, 0.0)
 +
</syntaxhighlight>
 +
 +
By activating the Plotter, the value can even be made visible as a graph
 +
 +
 +
    
{{ENG-CANSAT-PICO-TRAILER}}
 
{{ENG-CANSAT-PICO-TRAILER}}
29 917

modifications

Menu de navigation