38#define SPI_FAST_SPEED 1000000
58 Serial.println(
"ERROR: beginSPI() failed");
63 Serial.println(
"Ready.");
76 Serial.print(F(
"ACC [g]: "));
77 Serial.print(ax, 3); Serial.print(
", ");
78 Serial.print(ay, 3); Serial.print(
", ");
79 Serial.println(az, 3);
81 Serial.println(F(
"ACC read failed"));
86 Serial.print(F(
"GYR [dps]: "));
87 Serial.print(gx, 2); Serial.print(
", ");
88 Serial.print(gy, 2); Serial.print(
", ");
89 Serial.println(gz, 2);
91 Serial.println(F(
"GYR read failed"));
96 Serial.print(F(
"TMP [C]: "));
97 Serial.println(tC, 2);
99 Serial.println(F(
"TMP read failed"));
102 Serial.println(F(
"-----------------------------"));
bool readGyro(float &x, float &y, float &z)
bool readAccel(float &x, float &y, float &z)
bool beginSPI(uint8_t csPin, SPIClass &spiPort=SPI, uint32_t spiSpeed=1000000)
bool readTemperature(float &temperature)
bool setSensors(bool accel_on, bool gyro_on, bool temp_on)
void setup()
Initialize Serial and start the ICM-20948 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.
#define CS_PIN
Chip-select pin for SPI.
void loop()
Read and print accelerometer, gyroscope, and temperature data.