Module to read from the HMC5883L Magnetometer
npm install hmc5883l-piAccess to the HCM5883L digital compass on the Raspberry Pi.
$ npm install hcm5883l-pi
readMag() that returns an object containing the x, y and z portions of the vector.````
var HMC5883L = require("hmc5883l-pi");
var data = HMC5883L.readMag();
console.log("Got compass data!");
console.dir(data);
console.log("x=" + data.x + ", y=" + data.y + ", z=" + data.z);