temp and pressure sensor
#include <Wire.h> #define BMP180_ADDRESS 0x77 // I2C address of BMP180 const float p0 = 101325; // Pressure at sea level (Pa) float altitude; const unsigned char OSS = 0; // Oversampling Setting // Read 1 byte from the BMP180 at 'address' char bmp180Read(unsigned char address) { unsigned char data; Wire.beginTransmission(BMP180_ADDRESS); Wire.write(address); Wire.endTransmission(); Wire.requestFrom(BMP180_ADDRESS, 1); while(!Wire.available()) ; return Wire.read(); } // Read 2 bytes from the BMP180 // First byte will be from 'address' // Second byte will be from 'address'+1 int bmp180ReadInt(unsigned char address) { unsigned char msb, lsb; Wire.beginTransmission(BMP180_ADDRESS); Wire.write(address); Wire.endTransmission(); Wire.requestFrom(BMP180_ADDRESS, 2); while(Wire.available()<2) ; msb = Wire.read(); lsb = Wire.read(); return (int) ...