36#define SPI_FAST_SPEED 1000000
53 Serial.println(F(
"ICM-20948 (SPI) — Gyro Example"));
59 Serial.println(
"ERROR: beginSPI() failed");
65 Serial.println(F(
"ERROR: applyBasicDefaults() failed."));
69 Serial.println(F(
"ICM-20948 ready."));
76 Serial.println(F(
"setSensors failed."));
100 Serial.println(F(
"setGyroDLPF failed."));
103 Serial.println(F(
"setGyroScale failed."));
114 Serial.println(F(
"setGyroDivRate failed."));
131 Serial.print(
"GYRO [dps]: ");
136 Serial.println(gz, 3);
139 Serial.println(F(
"GYRO read failed"));
142 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 beginSPI(uint8_t csPin, SPIClass &spiPort=SPI, uint32_t spiSpeed=1000000)
bool setGyroScale(ICM20948_Gyro_FullScale fullScale)
bool setSensors(bool accel_on, bool gyro_on, bool temp_on)
void setup()
Configure the IMU for gyroscope-only operation over SPI.
SPIClass spi_bus(SPI)
SPI bus object used by the IMU driver.
#define SPI_FAST_SPEED
SPI clock used during sensor initialization and reads.
DevLab_ICM20948 imu
Global ICM-20948 driver instance.
void loop()
Read and print gyroscope data in degrees per second.