Skip to content
Reads the Compass Module 3-Axis HMC5883L and prints the data over the serial connection to the computer.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



In this example we’re going to deal with the Compass Module 3-Axis HMC5883L from Parallax and how to integrate it into an Arduino.

The Compass Module 3-Axis HMC5883L is designed for low-field magnetic sensing with a digital interface. This compact sensor fits into small projects such as UAVs and robot navigation systems.

The sensor converts any magnetic field to a differential voltage output on 3 axes. This voltage shift is the raw digital output value, which can then be used to calculate headings or sense magnetic fields coming from different directions. Example code in PBASIC, Spin, and C are provided in the downloads.

The Details:

For more info please see:


If you care to contribute at all then please see the CONTRIBUTING File for more details.


This application is licensed under the Mozilla Public License Version 2.0. Please see the LICENSE File for more details.

You can’t perform that action at this time.