Modifications
Sauter à la navigation
Sauter à la recherche
← Modification précédente
Modification suivante →
ENG-CANSAT-BMP280
(voir la source)
Version du 2 octobre 2018 à 17:15
870 octets ajoutés
,
2 octobre 2018 à 17:15
→Testing the sensor
Ligne 32 :
Ligne 32 :
[[Fichier:ENG-CANSAT-BMP280-03.png|640px]]
[[Fichier:ENG-CANSAT-BMP280-03.png|640px]]
+
+
<syntaxhighlight lang="c">
+
#include <Wire.h>
+
#include <Adafruit_Sensor.h>
+
#include <Adafruit_BMP280.h>
+
+
+
Adafruit_BMP280 bme; // I2C
+
+
void setup() {
+
Serial.begin(9600);
+
Serial.println(F("BMP280 test"));
+
+
if (!bme.begin()) {
+
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
+
while (1);
+
}
+
}
+
+
void loop() {
+
Serial.print("Temperature = ");
+
Serial.print(bme.readTemperature());
+
Serial.println(" *C");
+
+
Serial.print("Pressure = ");
+
Serial.print(bme.readPressure());
+
Serial.println(" Pa");
+
+
Serial.print("Approx altitude = ");
+
// 1013.25 is the pressure at sea level. It should be ajusted
+
// with your local forecast for a corect evaluation of altitude
+
Serial.print(bme.readAltitude(1013.25));
+
Serial.println(" m");
+
+
Serial.println();
+
delay(2000);
+
}
+
</syntaxhighlight>
+
{{ENG-CANSAT-TRAILER}}
{{ENG-CANSAT-TRAILER}}
Admin
Bureaucrates
,
Administrateurs
29 910
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