Was wondering about that when I saw it in firmware for the m5stack - didn't see it on the schematic though.Tried imu.begin(&Serial) and did not get any output. Since you ordered one, the first hangup I hit is trying to use Wire but the M5 library has it setup for external i2c devices. Wire1 works for the internal i2c.
// Match axis orientation from example
val[0] = -ay;
val[1] = -ax;
val[2] = -az;
val[3] = -gy ;
val[4] = -gx ;
val[5] = -gz ;
val[6] = mx / 10.0f;
val[7] = my / 10.0f;
val[8] = mz / 10.0f;
#if defined ( CONFIG_IDF_TARGET_ESP32S3 )
if (board == m5::board_t::board_M5StackCoreS3 && bmi2->getAddress() == 0x69)
{ // CoreS3 では、地磁気のY軸Z軸をそれぞれ反転する
_internal_axisorder_fixed[sensor_index_mag] = (internal_axisorder_t)(axis_invert_y | axis_invert_z); // Y軸,Z軸反転
} else
if (board == m5::board_t::board_M5AtomS3R || board == m5::board_t::board_M5AtomS3RCam || board == m5::board_t::board_M5AtomS3RExt)
{ // AtomS3Rシリーズ では、ジャイロと加速度のY軸とX軸を入れ替え、Y軸を反転するほか、地磁気のX軸とZ軸をそれぞれ反転する
//Then, the gyro and acceleration Y-axis and X-axis are swapped, and the Y-axis is reversed, and the X-axis and Z-axis of the geomagnetic field are reversed, respectively
// _internal_axisorder_fixed[sensor_index_accel] = (internal_axisorder_t)(axis_order_yxz | axis_invert_y);
// _internal_axisorder_fixed[sensor_index_gyro ] = (internal_axisorder_t)(axis_order_yxz | axis_invert_y);
// _internal_axisorder_fixed[sensor_index_mag ] = (internal_axisorder_t)(axis_invert_x | axis_invert_z); // X-axis, Z-axis inversion
_internal_axisorder_fixed[sensor_index_accel] = (internal_axisorder_t)(axis_order_xyz);
_internal_axisorder_fixed[sensor_index_gyro ] = (internal_axisorder_t)(axis_order_xyz);
_internal_axisorder_fixed[sensor_index_mag ] = (internal_axisorder_t)(axis_order_xyz ); // X-axis,
}
#endif
Accel X Bias: 0.046889
Accel X Scale Factor: 1.001222
Accel Y Bias: 0.046889
Accel Y Scale Factor: 1.003922
Accel Z Bias: 0.040066
Accel Z Scale Factor: 0.997322
Nope. Forgot o post it: https://x-io.co.uk/x-imu3/ scroll down to the downloads sectionIt’s ximu3. Think the link is in post #1
Strange - mine was steady.However, when I show in imu3 all looks ok but after a yaw movement, it will reach a position, and then drift away when holding steady. Created the attached sketch and heading is all over the place.
Cannot express how thankful I am for all of your work. Tied up with kids at Christmas today but hopefully can get some time tonight or tomorrow.@russellkt
Spent some more time on this and got my library working with the AtomS3R. All files for using the Library with the S3R and the files for working with the builtin lib have been posted to:
![]()
GitHub - mjs513/M5-AtomS3R-IMU
Contribute to mjs513/M5-AtomS3R-IMU development by creating an account on GitHub.github.com
Thats strange seems to be working for me. Did you use the updated sketches I had for MotionCal?Sorry for the delay. Thank you again for all of your work! Unfortunately, I adjusted the orientation in the m5 library, calibrated the atom using motioncal, inputted the values, and am still getting very sketchy results. Compass only goes between ~150 and ~190 degrees. At this time, I'm I will probably abandon for the time being until I can get another one to rule out any board or sensor issues.