Skip to content

Commit

Permalink
Print the IMU information in imu command
Browse files Browse the repository at this point in the history
  • Loading branch information
okalachev committed Oct 31, 2024
1 parent 39d4f39 commit ad2c646
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions flix/cli.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions flix/imu.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

0 comments on commit ad2c646

Please sign in to comment.