BMP et ESP8266
Branchement et code
1
2
3
4
Adafruit_BMP085 bmp;
5
6
void setup(){
7
Serial.begin(9600);
8
9
Wire.begin(4, 5);
10
if (!bmp.begin()) {
11
Serial.println("BMP180 / BMP085 introuvable ! Verifier le branchement ");
12
while (1) {}
13
}
14
}
15
16
void loop(){
17
18
Serial.print("Temperature = ");
19
Serial.print(bmp.readTemperature());
20
Serial.print(" *C");
21
22
Serial.print(" | Pression = ");
23
Serial.print(bmp.readPressure());
24
Serial.print(" Pa");
25
26
Serial.print(" | Altitude = ");
27
Serial.print(bmp.readAltitude());
28
Serial.println(" metres");
29
30
delay(5000);
31
}
32
Le fichier Fritzing
La bibliothèque