GY-273 HCM5883l

I'm trying to make a digital compass. I'm very new to programming. I have my GY-273 sending outputs, but I think that the scaling is off. Is there a good tutorial on this topic? I don't want to just copy and paste code I would like to understand what is going on.

These are the values that its returning, I just don't know how to turn that into 360 deg of a compass

x: 1755 y: 21753 z: 5376
x: 1785 y: 19961 z: 5376
x: 1760 y: 20729 z: 5376
x: 1586 y: 18169 z: 5632
x: 1790 y: 17657 z: 5376
x: 1790 y: 20729 z: 5380
x: 1551 y: 20473 z: 5632
x: 1561 y: 17145 z: 5632
x: 1765 y: 19449 z: 5376
x: 1765 y: 17657 z: 5376
x: 1737 y: 17913 z: 5376
x: 1571 y: 17401 z: 5632
x: 1551 y: 17145 z: 5632

sketch_dec21c.ino (1.14 KB)

Compass_Calibration.ino (3.38 KB)

Google "arduino digital compass" for a number of tutorials and project desciptions. Also look up "tilt compensated compass", for which you need an accelerometer as well.

You must calibrate the magnetometer, or it won't work correctly. Overview here