Modifications

Sauter à la navigation Sauter à la recherche
175 octets ajoutés ,  26 février 2022 à 23:57
Ligne 91 : Ligne 91 :     
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
 +
# Read the sensor values:
 +
#    (temperature_celcius, pressure_hpa, humidity_percent)
 +
#    Humidity only applies to BME280 only, not BMP280.
 +
#
 
from machine import I2C
 
from machine import I2C
 
# BME280 aslo work for BMP280
 
# BME280 aslo work for BMP280
Ligne 104 : Ligne 108 :     
Which produce the following results:
 
Which produce the following results:
 
+
<nowiki>(22.28, 1017.68, 0.0)
<syntaxhighlight lang="bash">
  −
(22.28, 1017.68, 0.0)
   
(22.27, 1017.66, 0.0)
 
(22.27, 1017.66, 0.0)
 
(21.87, 1017.67, 0.0)
 
(21.87, 1017.67, 0.0)
Ligne 112 : Ligne 114 :  
(21.83, 1017.68, 0.0)
 
(21.83, 1017.68, 0.0)
 
(21.81, 1017.68, 0.0)
 
(21.81, 1017.68, 0.0)
(21.81, 1017.68, 0.0)
+
(21.81, 1017.68, 0.0)</nowiki>
</syntaxhighlight>
      
By activating the Plotter, the value can even be made visible as a graph. However, to see a proper graph evolution, the best is to replace the {{fname|sleep(1)}} to {{fname|sleep( 60*30 )}} (30 min).
 
By activating the Plotter, the value can even be made visible as a graph. However, to see a proper graph evolution, the best is to replace the {{fname|sleep(1)}} to {{fname|sleep( 60*30 )}} (30 min).
Ligne 149 : Ligne 150 :     
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
 +
# Read Local pressure then
 +
# Calculate corresponding Altitude
 +
#
 
from machine import I2C
 
from machine import I2C
 
# BME280 aslo work for BMP280
 
# BME280 aslo work for BMP280
29 917

modifications

Menu de navigation