Anvendelse af GY-271 HMC5883L 3V-5V Triple Axis Compass Magnetometer Sensor Module
Materialer:
Komponentplacering:
Programmering:
QMC5883LCompass Library til programmet
/*
GY-271 Compass
modified on 02 Sep 2020
by Mohammad Reza Akbari @ Electropeak
*/
// I2C Library
#include <Wire.h>
// QMC5883L Compass Library
#include <QMC5883LCompass.h>
QMC5883LCompass compass;
void setup() {
// Initialize the serial port.
Serial.begin(9600);
// Initialize I2C.
Wire.begin();
// Initialize the Compass.
compass.init();
}
Data fra sensor: