I'm getting really bad magnetometer readings from AtomS3R bmm150
using m5stack libraries.
atan2(mag.x, mag.y) should give some reasonable result in radians.
However I do not see it being even close.
My code:
https://github.com/bareboat-necessities/bbn-atomS3R/blob/07bdf3e322c907e398563786f0af95e70cd635ac/bbn_atomS3R_mahony/bbn_atomS3R_mahony.ino
I think there is a bug in m5stack unified library which reads that sensor.
Thanks,