Created
March 7, 2025 07:07
-
-
Save fxprime/3eefc0416625081e9a50517e073a9afc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <QMC5883LCompass.h> | |
/* | |
lib: mprograms/QMC5883LCompass @ ^1.2.3 | |
*/ | |
QMC5883LCompass compass; | |
void setup() { | |
Serial.begin(115200); | |
compass.init(); | |
} | |
void loop() { | |
int a; | |
// Read compass values | |
compass.read(); | |
// Return Azimuth reading | |
a = compass.getAzimuth(); | |
Serial.print("A: "); | |
Serial.print(a); | |
Serial.println(); | |
delay(250); | |
} | |
/* | |
A: 142 | |
A: 144 | |
A: 142 | |
A: 144 | |
A: 141 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment