Skip to main content
.NETnanoFramework1.0

Iot.Device.Lps22Hb assembly for .NET nanoFramework C# projects

Published
Jun 1, 2026
4mo ago
Total Downloads
7.1K
7,051

Install

dotnet add package nanoFramework.Iot.Device.Lps22Hb --version 2.0.0-preview.85
ProductVersions
Other
.NETnanoFramework1.0

README

LPS22HB - MEMS nano pressure sensor: 260-1260 hPa absolute digital output barometer

Some of the applications mentioned by the datasheet:

  • Altimeters and barometers for portable devices
  • GPS applications
  • Weather station equipment
  • Sport watches

Documentation

Usage

Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice, make sure you install the nanoFramework.Hardware.ESP32 nuget:

//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);

For other devices like STM32, please make sure you're using the preset pins for the I2C bus you want to use.

using Iot.Device.Lps22Hb;
using System.Device.I2c;
using System.Diagnostics;
using System.Threading;

using Lps22Hb lps22HdDevice = new(CreateI2cDevice(), FifoMode.Bypass);

while (true)
{
    var tempValue = lps22HdDevice.Temperature;
    var pressure = lps22HdDevice.Pressure;

    Debug.WriteLine($"Temperature: {tempValue.DegreesCelsius:F1}\u00B0C");
    Debug.WriteLine($"Pressure: {pressure.Hectopascals:F1}hPa");

    Thread.Sleep(1000);
}

I2cDevice CreateI2cDevice()
{
    I2cConnectionSettings settings = new(1, Lps22Hb.DefaultI2cAddress);
    return I2cDevice.Create(settings);
}

Changes from Previous Version

No structural changes between v2.0.0-preview.80 and v2.0.0-preview.85.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.