I just got my new GIGA Board and GIGA Shield. I am using the following example code and I see the following on Serial Monitor. imu.accelerationAvailable() is always returning false and not working. How do I solve this? This is OOTB example. (Note: I already fixed the code in the setup loop by using "if (imu.begin() == 1)". Saw this problem on another post)
12:08:03.642 -> Started
12:08:03.642 -> Accelerometer sample rate = 99.84 Hz
12:08:03.642 ->
12:08:03.642 -> Acceleration in G's
12:08:03.642 -> X Y Z
#include "Arduino_BMI270_BMM150.h"
BoschSensorClass imu(Wire1);
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Started");
if (imu.begin() == 1) {
Serial.println("Failed to initialize imu!");
while (1);
}
Serial.print("Accelerometer sample rate = ");
Serial.print(imu.accelerationSampleRate());
Serial.println(" Hz");
Serial.println();
Serial.println("Acceleration in G's");
Serial.println("X\tY\tZ");
}
void loop() {
float x, y, z;
if (imu.accelerationAvailable()) {
imu.readAcceleration(x, y, z);
Serial.print(x);
Serial.print('\t');
Serial.print(y);
Serial.print('\t');
Serial.println(z);
}
}
