65 Serial.println(
"BMA4xx sensor initialization failed");
71 Serial.println(
" Sensor initialized successfully");
76 Serial.println(
"Failed to set remap axes");
87 float data_rate_hz = 100.0f;
92 Serial.println(
"Failed to configure accelerometer");
99 Serial.println(
"Failed to enable data ready");
105 Serial.println(
"Now read accelerometer data form sensor");
114 Serial.print(
"Temperature: ");
116 Serial.print(
" °C, Acc_Raw: (");
117 Serial.print(accelData.
raw.
x);
119 Serial.print(accelData.
raw.
y);
121 Serial.print(accelData.
raw.
z);
122 Serial.print(
"), Acc_ms2: (");
123 Serial.print(accelData.
mps2.
x, 2);
125 Serial.print(accelData.
mps2.
y, 2);
127 Serial.print(accelData.
mps2.
z, 2);
130 Serial.print(timeSampleMs);
131 Serial.print(
"(ms)/");
132 Serial.print(millis());
135 Serial.println(
"Failed to read accelerometer data");
OperationMode
Enumeration of sensor operation modes.
AccelFullScaleRange
Enumeration of accelerometer full-scale range settings.
SensorBMA456H accelSensor
volatile bool isInterruptTriggered
bool begin(CommInterface interface, SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_callback, uint8_t addr=0)
Initialize the sensor using custom callback interface.
bool enableDataReady(bool enable=true, InterruptPinMap pin_map=InterruptPinMap::PIN1) override
Enable data ready interrupt.
bool isDataReady() override
Check if new accelerometer data is available.
virtual bool setRemapAxes(SensorRemap remap)
Set the remapping of axes for the BMA4XX sensor.
uint32_t getTimeSampleMs() const
Get the current sensor time in milliseconds.
const char * getModelName() const
Get the model name of the BMA4XX sensor.
bool readData(AccelerometerData &data) override
Get the accelerometer data.
bool configAccelerometer(OperationMode mode, AccelFullScaleRange range, float data_rate_hz, AccelBandwidth bandwidth, AccelPerfMode perf_mode)
Configure the accelerometer.
AccelBandwidth
BMA4 Accelerometer averaging filter configuration These values configure the internal averaging filte...
@ OSR2_AVG2
OSR2 mode with 2 samples averaged.
AccelPerfMode
BMA4 Accelerometer performance mode configuration Configures the internal filter behavior for sample ...
@ CIC_AVG_MODE
Averaging filter mode: samples are averaged based on configured bandwidth and ODR.
Structure representing accelerometer data.
SensorVector mps2
Acceleration in meters per second squared (m/s²)
float temperature
Temperature in degrees Celsius (if available)
RawVector raw
Raw sensor values in LSB (least significant bits)
int16_t x
X-axis raw value.
int16_t y
Y-axis raw value.
int16_t z
Z-axis raw value.