You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
byte a = compass.getAzimuth();
// Output here will be a value from 0 - 15 based on the direction of the bearing / azimuth.
byte b = compass.getBearing(a);
I had what seems a similar problem.
Rotating clockwise, the readings went N NE E SE S and then straight back to N. Nothing in the W region.
Long story short, the azimuth readings were going 0 45 90 135 180 and then -180 -135 -90 -45.
I corrected for this using ... if(azimuth<0){azimuth=360+azimuth};
Hi ,
At first , I run the calibration.ino ont the GY-271(QMC5883L). and get the calibration data.
I copy its to bearing.ino.
And then I run the bearing.ino.
The North is 0 deg, NE=2 deg, E=4, SE=5, S=6, SW=7, W=4, NW=8.
Does it SW or HW issue??
=== bearing.ino ==
#include <QMC5883LCompass.h>
QMC5883LCompass compass;
void setup() {
Serial.begin(9600);
compass.init();
compass.setCalibrationOffsets(41.00, -159.00, -436.00);
compass.setCalibrationScales(1.09, 0.93, 0.99);
}
void loop() {
compass.read();
byte a = compass.getAzimuth();
// Output here will be a value from 0 - 15 based on the direction of the bearing / azimuth.
byte b = compass.getBearing(a);
Serial.print("B: ");
Serial.print(b);
Serial.println();
delay(250);
}
The text was updated successfully, but these errors were encountered: