• @user111620 you'll need to update your Bangle.js firmware to the latest version to have it reliable.

    Right now we use just the magnetometer X and Y values for the angle. If you don't hold it level then like a real compass it'll read differently.

    I guess you can't easily just add the Z value in, so I guess as you say I think you'd have to:

    • Look at the accelerometer values
    • work out a 'corrected' dy based on something like mag.dy*accel.z + mag.dz*accel.y (may not be exactly that, but that's the idea)
    • Use Math.atan2 to work out the angle from dx/dy

About

Avatar for Gordon @Gordon started