Home Code BMP085 example

BMP085 example

by shedboy71
[lebox id="1"]

This example uses the BMP05 Barometric, pressure and Temperature sensor. It requires the BMP085 library from adafruit. This is a nice little sensor.

 
[c]
#include <Wire.h>
#include <Adafruit_BMP085.h>

Adafruit_BMP085 bmp;

void setup()
{
Serial.begin(9600);
if (!bmp.begin())
{
Serial.println(“Could not find a BMP085 sensor!”);
while (1) {}
}
}

void loop()
{
Serial.print(“Temperature = “);
Serial.print(bmp.readTemperature());
Serial.println(” *C”);

Serial.print(“Pressure = “);
Serial.print(bmp.readPressure());
Serial.println(” Pa”);

Serial.print(“Altitude = “);
Serial.print(bmp.readAltitude());
Serial.println(” meters”);

Serial.print(“Real altitude = “);
Serial.print(bmp.readAltitude(101500));
Serial.println(” meters”);

Serial.println();
delay(500);
}
[/c]

Share
[lebox id="2"]

You may also like