3 axis magnetometer calculation

Hi,

I have a project using a 3 axis magnetometer.

I’ve been trying to get results for a long time, with great help from other forums, but so far I have been able to get correct results.

I don’t really want to ask the same questions as I have so far.

Here is the equation, which works with my system: arctn = ax / ay / (1 + 0.28125 * ((ax / ay) * (ax / ay))) * picalc '180/PI

So that I can progress and find out what’s wrong, I need to ad the ‘Z’ component to the calculation.

Can someone show me how to do this please?

Camerart.

Nothing in your post makes sense. Please re-read it, correct the obvious errors and add required information, such as what you are trying to do.

Magnetometers must be carefully calibrated to be useful. If you have not done that, study this overview: https://thecavepearlproject.org/2015/05 … r-arduino/