HMC6352 Digital Compass


Allows user to read heading from HMC6352 Digital Compass via i2c interface.

For more information click here.

How To Connect

Cylon.robot({
  connections: {
    arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
  },

  devices: {
    hmc6352: { driver: 'hmc6352' }
  },
});

How To Use

var Cylon = require('cylon');

Cylon.robot({
  connections: {
    arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
  },

  devices: {
    hmc6352: { driver: 'hmc6352' }
  },

  work: function(my) {
    every((1).second(), function() {
      my.hmc6352.heading(function(data) {
        console.log("heading: " + data);
      });
    });
  }}
).start();

Commands

heading

Returns the heading data for the compass.

Params

  • callback (Function) function to be invoked with data

Returns

  • (undefined)

Circuit

Compatibility