46#define I2C_FREQ 400000UL
62 Serial.println(F(
"ICM-20948 — I2C Basic"));
66 Serial.println(F(
"ERROR: beginI2C() failed"));
72 Serial.println(F(
"ERROR: applyBasicDefaults() failed."));
76 Serial.println(F(
"ICM-20948 ready."));
83 Serial.println(F(
"setSensors failed."));
105 Serial.println(F(
"setDLPF failed."));
109 Serial.println(F(
"setGyroScale failed."));
118 Serial.println(F(
"setGyroDivRate failed."));
135 Serial.print(
"GYRO [dps]: ");
140 Serial.println(gz, 3);
142 Serial.println(F(
"GYRO read failed"));
145 Serial.println(F(
"-----------------------------"));
bool readGyro(float &x, float &y, float &z)
bool setDLPF(ICM20948_Gyro_DLPF dlpf, bool bypass)
bool setGyroDivRate(uint8_t divisor)
bool applyBasicDefaults()
bool setGyroScale(ICM20948_Gyro_FullScale fullScale)
bool beginI2C(uint8_t address=0x69, TwoWire &i2cPort=Wire, uint32_t i2cSpeed=400000)
bool setSensors(bool accel_on, bool gyro_on, bool temp_on)
#define SCL_PIN
I2C SCL pin used by the example board.
void setup()
Configure the IMU for gyroscope-only operation over I2C.
#define SDA_PIN
I2C SDA pin used by the example board.
#define ICM_ADDR
ICM-20948 I2C address selected by the AD0 pin.
DevLab_ICM20948 imu
Global ICM-20948 driver instance.
void loop()
Read and print gyroscope data in degrees per second.