Hey everybody, I'm attaching the code written by me for the Zhichuan zcc210N 2-axis magnetometer compass module. It's cheap, supports I2C interface and spits out data pretty good, including Direction (N-NE-E-SE, ecc) and angle (0-360°). Tested on Arduino pro mini. Frrrrresh.
NOTE I wasn't able to clearly understand how calibration is made. However the compass works fine even without calibration; google "zcc210n datasheet" for further info.
Note2: you have to input your local magnetic declination and deviation angles in the respective tabs for true north correction.