Skip to content

Instantly share code, notes, and snippets.

@BlackMac
Created November 24, 2011 21:50
Show Gist options
  • Save BlackMac/1392381 to your computer and use it in GitHub Desktop.
Save BlackMac/1392381 to your computer and use it in GitHub Desktop.
Pololu MMA7341 and MMA7361 with Arduino
/**
VCC is connected to 3.3V
Make sure to connect Test to 3.3V or you will get garbage data!
*/
#define XOUT A0
#define YOUT A1
#define ZOUT A2
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print(analogRead(XOUT)/255.0);
Serial.print("-");
Serial.print(analogRead(YOUT)/255.0);
Serial.print("-");
Serial.println(analogRead(ZOUT)/255.0);
delay(200);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment