3-Axis Magnetic Field Sensor I2C Module GY-271 - Digital Output, I2C Interface - QMC5883L
- Was RM25.00
-
RM12.00
- Product Code: GY-271
- Availability: In Stock
This is a breakout board for QMC5883L (replacement of HMC5883L), a 3-axis digital compass. Communication with the QMC5883L is simple and all done through an I2C interface. There is an on board regulator. The breakout board includes the HMC5883L sensor and all filtering capacitors as shown. The power and 2-wire interface pins are all broken out to a 0.1" pitch header.
Documents
Library and example are included in: Mecha_QMC5883-master.zip (4.97KB)
#include <Wire.h> #include <MechaQMC5883.h> MechaQMC5883 qmc; void setup() { Wire.begin(); Serial.begin(9600); qmc.init(); //qmc.setMode(Mode_Continuous,ODR_200Hz,RNG_2G,OSR_256); } void loop() { int x,y,z; qmc.read(&x,&y,&z); Serial.print("x: "); Serial.print(x); Serial.print(" y: "); Serial.print(y); Serial.print(" z: "); Serial.print(z); Serial.println(); delay(100); }