nanoFramework.Iot.Device.Lis3Dh
1.0.1
Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Lis3Dh --version 1.0.1
NuGet\Install-Package nanoFramework.Iot.Device.Lis3Dh -Version 1.0.1
<PackageReference Include="nanoFramework.Iot.Device.Lis3Dh" Version="1.0.1" />
<PackageVersion Include="nanoFramework.Iot.Device.Lis3Dh" Version="1.0.1" />
<PackageReference Include="nanoFramework.Iot.Device.Lis3Dh" />
paket add nanoFramework.Iot.Device.Lis3Dh --version 1.0.1
#r "nuget: nanoFramework.Iot.Device.Lis3Dh, 1.0.1"
#:package nanoFramework.Iot.Device.Lis3Dh@1.0.1
#addin nuget:?package=nanoFramework.Iot.Device.Lis3Dh&version=1.0.1
#tool nuget:?package=nanoFramework.Iot.Device.Lis3Dh&version=1.0.1
LIS3DH - ultra-low-power high-performance 3-axis accelerometer
The LIS3DH is an ultra-low-power, high-performance three-axis linear accelerometer from STMicroelectronics. It supports selectable plus or minus 2 g, 4 g, 8 g, and 16 g full-scale ranges. The sensor supports I2C and SPI; this binding currently supports I2C.
Documentation
Wiring
Connect VIN and GND according to the breakout board requirements, then connect SDA and SCL to the selected I2C bus. Tie SDO/SA0 low to use DefaultI2cAddress (0x18) or high to use SecondaryI2cAddress (0x19).
On ESP32, configure the I2C pins before creating the device:
Configuration.SetPinFunction(Gpio.IO21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(Gpio.IO22, DeviceFunction.I2C1_CLOCK);
For STM32 and other targets, use the hardware I2C pins configured by the firmware.
Usage
using Iot.Device.Lis3DhAccelerometer;
using System.Device.I2c;
using System.Diagnostics;
using System.Numerics;
using System.Threading;
I2cConnectionSettings settings = new(1, Lis3Dh.DefaultI2cAddress);
using I2cDevice i2cDevice = I2cDevice.Create(settings);
using Lis3Dh accelerometer = Lis3Dh.Create(
i2cDevice,
DataRate.DataRate10Hz,
OperatingMode.HighResolutionMode,
AccelerationScale.Scale04G);
while (true)
{
Vector3 acceleration = accelerometer.Acceleration;
Debug.WriteLine($"X: {acceleration.X:F4} g, Y: {acceleration.Y:F4} g, Z: {acceleration.Z:F4} g");
Thread.Sleep(100);
}
Acceleration returns a Vector3 whose components are measured in gravitational force (g).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net is compatible. |
-
- nanoFramework.CoreLibrary (>= 1.17.11)
- nanoFramework.System.Buffers.Binary.BinaryPrimitives (>= 1.2.862)
- nanoFramework.System.Device.Gpio (>= 1.1.64)
- nanoFramework.System.Device.I2c (>= 1.1.29)
- nanoFramework.System.Device.Model (>= 1.2.862)
- nanoFramework.System.Math (>= 1.5.116)
- nanoFramework.System.Numerics (>= 1.2.862)
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 |
|---|---|---|
| 1.0.1 | 99 | 9/29/2026 |