mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
[lis3dh] Add LIS3DH accelerometer component (#17393)
Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
co-authored by
Claude
pre-commit-ci-lite[bot]
J. Nick Koston
parent
93183c661e
commit
584d4878eb
@@ -0,0 +1,67 @@
|
||||
motion:
|
||||
- platform: lis3dh
|
||||
id: lis3dh_main
|
||||
i2c_id: i2c_bus
|
||||
accelerometer_range: 2G
|
||||
accelerometer_odr: 100HZ
|
||||
operating_mode: HIGH_RESOLUTION
|
||||
axis_map:
|
||||
x: y
|
||||
y: x
|
||||
z: -z
|
||||
# Motion (activity) interrupt - keeps the INT pad asserted while moving so it
|
||||
# can be used as the deep_sleep wakeup_pin.
|
||||
interrupt:
|
||||
pin: INT1
|
||||
threshold: 1.1g
|
||||
duration: 0ms
|
||||
axes: [x, y, z]
|
||||
latched: true
|
||||
active_high: true
|
||||
high_pass_filter: false
|
||||
|
||||
# A second device covering the other side of each option: low power mode with
|
||||
# the rate that only exists there, routed to INT2, active low, unlatched, and
|
||||
# with the high-pass filter on.
|
||||
- platform: lis3dh
|
||||
id: lis3dh_low_power
|
||||
i2c_id: i2c_bus
|
||||
address: 0x19
|
||||
accelerometer_range: 16G
|
||||
accelerometer_odr: 1620HZ
|
||||
operating_mode: LOW_POWER
|
||||
interrupt:
|
||||
pin: INT2
|
||||
threshold: 0.05g
|
||||
duration: 1ms
|
||||
axes: [z]
|
||||
latched: false
|
||||
active_high: false
|
||||
high_pass_filter: true
|
||||
|
||||
sensor:
|
||||
- platform: lis3dh
|
||||
lis3dh_id: lis3dh_main
|
||||
type: temperature
|
||||
name: "LIS3DH Temperature"
|
||||
|
||||
- platform: motion
|
||||
motion_id: lis3dh_main
|
||||
type: acceleration_x
|
||||
name: "Accel X"
|
||||
- platform: motion
|
||||
motion_id: lis3dh_main
|
||||
type: acceleration_y
|
||||
name: "Accel Y"
|
||||
- platform: motion
|
||||
motion_id: lis3dh_main
|
||||
type: acceleration_z
|
||||
name: "Accel Z"
|
||||
- platform: motion
|
||||
motion_id: lis3dh_main
|
||||
type: pitch
|
||||
name: "Pitch"
|
||||
- platform: motion
|
||||
motion_id: lis3dh_main
|
||||
type: roll
|
||||
name: "Roll"
|
||||
@@ -0,0 +1,3 @@
|
||||
packages:
|
||||
i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml
|
||||
lis3dh: !include common.yaml
|
||||
@@ -0,0 +1,3 @@
|
||||
packages:
|
||||
i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml
|
||||
lis3dh: !include common.yaml
|
||||
Reference in New Issue
Block a user