Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QMC5883LCompass.h>
- QMC5883LCompass compass;
- int Read1stAngle = 0;
- int StartAngle = 0;
- void setup() {
- Serial.begin(115200);
- compass.init();
- }
- void loop() {
- int Direction;
- char myArray[3];
- compass.read();
- Direction = compass.getAzimuth();
- if ( Read1stAngle == 0 ) { //Store start angle
- StartAngle = Direction;
- Read1stAngle = 1;
- }
- Serial.print("Heading: ");
- Serial.print(Direction);
- Serial.print(" / StartAngle: ");
- Serial.print(StartAngle);
- Serial.print(" / Read1stAngle: ");
- delay(250);
- }
Add Comment
Please, Sign In to add comment