Skip to content

LeSuedois/LPS35HW

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LPS35HW pressure sensor library (I2C)

Build Status Framework Badge Arduino

Fully compatible with following barometers

  • LPS22HB
  • LPS33W
  • LPS33HW

This library works with metric units, if you need imperial please consider using MeteoFunctions library, please see example below.

#include <Wire.h>
#include "LPS35HW.h"
#include "MeteoFunctions.h"

LPS35HW lps;
MeteoFunctions calc;

const float above_sea = 1000;  // ft

void setup() {
    Serial.begin(9600);
    Serial.println("LPS barometer test");

    if (!lps.begin()) {
        Serial.println("Could not find a LPS barometer, check wiring!");

        while (1) {}
    }
}

void loop() {
    float pressure = lps.readPressure();
    float temp = calc.c_f(lps.readTemp());

    Serial.print("Pressure: ");
    Serial.print(calc.relativePressure_f(pressure, above_sea, temp));
    Serial.print("inHg\ttemperature: ");
    Serial.print(temp);
    Serial.println("*F\n");

    delay(1000);
}

About

Pressure sensor library for Arduino

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 100.0%