Last active
December 18, 2015 03:49
-
-
Save devdsp/5721198 to your computer and use it in GitHub Desktop.
simple north paw
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 <Wire.h> | |
void setup() | |
{ | |
Wire.begin(); | |
} | |
void loop() | |
{ | |
Wire.beginTransmission(0x21); | |
Wire.write("A"); | |
Wire.endTransmission(); | |
delay(10); | |
Wire.requestFrom(0x21, 2); | |
unsigned int headingValue = ((Wire.read() <<8) | Wire.read()); | |
digitalWrite(13, headingValue < 75 || headingValue > 3525); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment