|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
@license MIT License More...
#include <AccelerometerDrv.hpp>Go to the source code of this file.
Macros | |
| #define | SENSOR_SDA 21 |
| #define | SENSOR_SCL 22 |
| #define | SENSOR_IRQ 39 |
Functions | |
| void | onAnyMotionDetected () |
| void | setup () |
| void | loop () |
Variables | |
| SensorBMA456H | accelSensor |
| volatile bool | isInterruptTriggered = false |
@license MIT License
Copyright (c) 2026 lewis he
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file bma456h_any_motion.ino.
| #define SENSOR_IRQ 39 |
Definition at line 41 of file bma456h_any_motion.ino.
| #define SENSOR_SCL 22 |
Definition at line 37 of file bma456h_any_motion.ino.
| #define SENSOR_SDA 21 |
Definition at line 33 of file bma456h_any_motion.ino.
| void loop | ( | ) |
Definition at line 153 of file bma456h_any_motion.ino.
References accelSensor, isInterruptTriggered, and SensorBMA456H::update().
| void onAnyMotionDetected | ( | ) |
Definition at line 49 of file bma456h_any_motion.ino.
Referenced by setup().
| void setup | ( | ) |
< Enable motion detection on X-axis (1=enabled, 0=disabled)
< Enable motion detection on Y-axis (1=enabled, 0=disabled)
< Enable motion detection on Z-axis (1=enabled, 0=disabled)
Definition at line 54 of file bma456h_any_motion.ino.
References accelSensor, ComplexStaticDeviceWithHal::begin(), CIC_AVG_MODE, SensorBMA4XX::configAccelerometer(), SensorBMA456H::configAnyMotion(), SensorBMA456H::enableAnyMotionDetection(), FS_2G, SensorBMA4XX::getModelName(), isInterruptTriggered, NORMAL, onAnyMotionDetected(), OSR2_AVG2, PIN1, SENSOR_IRQ, SENSOR_SCL, SENSOR_SDA, SensorBMA4XX::setInterruptPinConfig(), SensorBMA456H::setOnAnyMotionCallback(), SensorBMA4XX::setRemapAxes(), TOP_LAYER_RIGHT_CORNER, SensorBMA4XX::MotionAxesConfig::x_axis, SensorBMA4XX::MotionAxesConfig::y_axis, and SensorBMA4XX::MotionAxesConfig::z_axis.
| SensorBMA456H accelSensor |
Definition at line 45 of file bma456h_any_motion.ino.
| volatile bool isInterruptTriggered = false |
Definition at line 47 of file bma456h_any_motion.ino.