From ad2c64625cc2a920c27355b55a106cef118ea8c4 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 31 Oct 2024 10:24:00 +0300 Subject: [PATCH] Print the IMU information in imu command --- flix/cli.ino | 1 + flix/imu.ino | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/flix/cli.ino b/flix/cli.ino index ab7ae8c..f414967 100644 --- a/flix/cli.ino +++ b/flix/cli.ino @@ -70,6 +70,7 @@ void doCommand(String& command, String& value) { } else if (command == "psq") { Serial.printf("qx: %f qy: %f qz: %f qw: %f\n", attitude.x, attitude.y, attitude.z, attitude.w); } else if (command == "imu") { + printIMUInfo(); Serial.printf("gyro: %f %f %f\n", rates.x, rates.y, rates.z); Serial.printf("acc: %f %f %f\n", acc.x, acc.y, acc.z); printIMUCal(); diff --git a/flix/imu.ino b/flix/imu.ino index e58460e..4caceed 100644 --- a/flix/imu.ino +++ b/flix/imu.ino @@ -122,3 +122,8 @@ void printIMUCal() { Serial.printf("accel bias: %f %f %f\n", accBias.x, accBias.y, accBias.z); Serial.printf("accel scale: %f %f %f\n", accScale.x, accScale.y, accScale.z); } + +void printIMUInfo() { + Serial.printf("type: %s\n", IMU.getType()); + Serial.printf("who am I: 0x%02X\n", IMU.whoAmI()); +}