Hi, I'm working with "Arduino Nicla Sense ME" and want to known...how to read the acceleration values (BHI260AP) by Data Ready Interrupt? Is it possible to read the acceleration values through the Data Ready Interrupt functionality? Therefore not based on the following condition: #include "Arduino_BHY2.h"
SensorXYZ accel(SENSOR_ID_ACC); // Accelerometer corrected
void setup(){
Serial.begin(115200);
BHY2.begin();
accel.begin(1000, 0); // sample-rate = 1000Hz, latency = 0ms (similar to Data-Ready Interrupt functionality)
}
void loop(){
static auto printTime = micros();
// Update function should be continuously polled
BHY2.update();
if (micros() - printTime >= 1000) { // new data every 1ms (1000Hz)???
printTime = micros();
Serial.println(String("acceleration: ") + accel.toString());
}
} Instead...trying to use the function get_interrupt_status() from <BoschSensortech.h> library: #include "Arduino_BHY2.h"
SensorXYZ accel(SENSOR_ID_ACC); // Accelerometer corrected
void setup(){
Serial.begin(115200);
BHY2.begin();
accel.begin(1000, 0); // sample-rate = 1000Hz, latency = 0ms (similar to Data-Ready Interrupt functionality)
}
void loop(){
static auto printTime = micros();
// Update function should be continuously polled
BHY2.update();
if (get_interrupt_status()) { // new data every 1ms (1000Hz)???
printTime = micros();
Serial.println(String("acceleration: ") + accel.toString());
}
} And as output...the acquisition frequency does not seem to be the one configured. Thanks to everyone!
... View more