nanoFramework.Iot.Device.Lps22Hb 1.0.453

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Lps22Hb --version 1.0.453
                    
NuGet\Install-Package nanoFramework.Iot.Device.Lps22Hb -Version 1.0.453
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Lps22Hb" Version="1.0.453" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Lps22Hb" Version="1.0.453" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Lps22Hb" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.Lps22Hb --version 1.0.453
                    
#r "nuget: nanoFramework.Iot.Device.Lps22Hb, 1.0.453"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.Lps22Hb@1.0.453
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Lps22Hb&version=1.0.453
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Lps22Hb&version=1.0.453
                    
Install as a Cake Tool

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);
}

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.32 43 4/20/2026
2.0.0-preview.16 64 3/10/2026
1.0.453 97 3/4/2026
1.0.432 236 11/10/2025
1.0.408 179 10/2/2025
1.0.390 166 7/28/2025
1.0.370 249 4/2/2025
1.0.365 213 4/2/2025
1.0.353 217 3/11/2025
1.0.347 231 3/10/2025
1.0.323 162 2/26/2025
1.0.276 169 2/4/2025
1.0.273 165 2/4/2025
1.0.256 160 1/31/2025
1.0.244 160 1/20/2025
1.0.238 151 1/13/2025
1.0.219 163 12/30/2024
1.0.205 172 12/18/2024
1.0.197 205 12/16/2024
1.0.174 178 10/23/2024
Loading failed