Skip to content

Instantly share code, notes, and snippets.

@elktros
Created March 29, 2021 10:29
Show Gist options
  • Save elktros/c938e84819f1d52c904098ee8c57c89e to your computer and use it in GitHub Desktop.
Save elktros/c938e84819f1d52c904098ee8c57c89e to your computer and use it in GitHub Desktop.
ESP32 BM180 Sensor with Serial Output.
#include <Adafruit_BMP085.h>
Adafruit_BMP085 bmp;;
void setup()
{
Serial.begin(115200);
if (!bmp.begin())
{
Serial.println("BMP180 Sensor not found ! ! !");
while (1)
{
}
}
}
void loop()
{
Serial.print("Pressure = ");
Serial.print(bmp.readPressure());
Serial.print(" hPa");
Serial.print(" Temp = ");
Serial.print(bmp.readTemperature());
Serial.println("ºC");
delay(3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment