nanoFramework.Iot.Device.Lps25h 1.2.1016

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.Lps25h --version 1.2.1016
                    
NuGet\Install-Package nanoFramework.Iot.Device.Lps25h -Version 1.2.1016
                    
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.Lps25h" Version="1.2.1016" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Lps25h" Version="1.2.1016" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Lps25h" />
                    
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.Lps25h --version 1.2.1016
                    
#r "nuget: nanoFramework.Iot.Device.Lps25h, 1.2.1016"
                    
#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.Lps25h@1.2.1016
                    
#: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.Lps25h&version=1.2.1016
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Lps25h&version=1.2.1016
                    
Install as a Cake Tool

LPS25H - Piezoresistive pressure and thermometer sensor

Some of the applications mentioned by the datasheet:

  • Altimeter and barometer for portable devices
  • GPS applications
  • Weather station equipment
  • Sport watches

Documentation

  • You can find the datasheet here

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.

class Program
{
    // I2C address on SenseHat board
    public const int I2cAddress = 0x5c;

    static void Main(string[] args)
    {
        using (var th = new Lps25h(CreateI2cDevice()))
        {
            while (true)
            {
                var tempValue = th.Temperature;
                var preValue = th.Pressure;
                var altValue = WeatherHelper.CalculateAltitude(preValue, defaultSeaLevelPressure, tempValue);

                Debug.WriteLine($"Temperature: {tempValue.Celsius:0.#}\u00B0C");
                Debug.WriteLine($"Pressure: {preValue.Hectopascal:0.##}hPa");
                Debug.WriteLine($"Altitude: {altValue:0.##}m");
                Thread.Sleep(1000);
            }
        }
    }

    private static I2cDevice CreateI2cDevice()
    {
        var settings = new I2cConnectionSettings(1, I2cAddress);
        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.109 58 7/13/2026
2.0.0-preview.94 72 6/22/2026
2.0.0-preview.85 65 6/1/2026
2.0.0-preview.80 60 5/27/2026
2.0.0-preview.73 77 5/20/2026
2.0.0-preview.69 77 5/18/2026
2.0.0-preview.62 72 5/13/2026
2.0.0-preview.49 60 5/4/2026
2.0.0-preview.45 76 4/29/2026
2.0.0-preview.37 67 4/22/2026
2.0.0-preview.32 63 4/20/2026
2.0.0-preview.16 76 3/10/2026
1.2.1016 115 7/13/2026
1.2.991 126 6/22/2026
1.2.952 145 3/4/2026
1.2.931 326 11/10/2025
1.2.907 277 10/2/2025
1.2.889 268 7/28/2025
1.2.869 348 4/2/2025
1.2.864 344 4/2/2025
Loading failed