Thumbnail

HMC5883 Compass

How to add the HMC5883 Compass robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the I2C category tab.
  5. Press the HMC5883 Compass icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the HMC5883 Compass robot skill.


How to use the HMC5883 Compass robot skill

The HMC5883 EZ-Bit module is a 3 axis compass sensor over an i2c connection. This ARC control will read data from the sensor and set EZ-Script Variables, respectively. The control will require an Initialization (INIT) before the sensor will return data. If the sensor is not connected, the EZ-B v4 will lock up. This control will not read data automatically. We have provided a ControlCommand() for querying the device and setting the variables. Each time you wish to receive data from the HMC5883, you must ask the control to RUN ONCE with ControlCommand().

Here is an example code for looping every 100 milliseconds to request data from the HMC5883 . Ensure you have an HMC5883 ARC control added, an HMC5883 connected to the i2c of the EZ-B, and paste this code into an EZ-Script control. When this script is running, the HMC5883 will continually update with data every 100ms...

ControlCommand("HMC5883 ", Init)

:loop

ControlCommand("HMC5883 ", RunOnce)
  
sleep(100)

goto(loop)

Note: Synthiam is not a manufacturer of this third party hardware device. . Nor is ezrobot responsible for the operation of this third party device. For operational questions, it's best to consult the instruction manual for operational instructions.


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.