Skip to content

Instantly share code, notes, and snippets.

@devdsp
Last active December 18, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdsp/5721198 to your computer and use it in GitHub Desktop.
Save devdsp/5721198 to your computer and use it in GitHub Desktop.
simple north paw
#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