Skip to content
Micropython driver for the HMC5883l on the ESP8266
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.


HMC5883L ESP8266 Micropython

A class for working with the HMC5883L 3-axis digital compass IC with micropython on the esp8266.


Upload to the micro-controller (e.g. you can use adafruit-ampy) and use as:

from hmc5883l import HMC5883L

sensor = HMC5883L(scl=4, sda=5)

x, y, z =
print(sensor.format_result(x, y, z))

The above will produce a line similar to:

X: -300.8398, Y: 106.7199, Z: -3768.3181, Heading: 160° 28′

That's about it - everything else can be figured out from the code and the links below.



All code and documentation released under the terms of the Revised BSD License.

You can’t perform that action at this time.