Modifications
Sauter à la navigation
Sauter à la recherche
← Modification précédente
Modification suivante →
ENG-CANSAT-PICO-BMP280
(voir la source)
Version du 26 février 2022 à 22:40
615 octets ajoutés
,
26 février 2022 à 22:40
→Testing the sensor
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}}
Admin
Bureaucrates
,
Administrateurs
29 917
modifications
Menu de navigation
Outils personnels
Se connecter
Espaces de noms
Page
Discussion
Variantes
Affichages
Lire
Voir le texte source
Voir l’historique
Plus
Rechercher
Navigation
ARDUINO
RASPBERRY-PI
[:: PI Hacking ::]
Particle.IO
Micro Python
Imprimante 3D
Actualités
Modifications récentes
Page au hasard
Aide
Outils
Pages spéciales
Version imprimable