Created
November 24, 2011 21:50
-
-
Save BlackMac/1392381 to your computer and use it in GitHub Desktop.
Pololu MMA7341 and MMA7361 with Arduino
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
/** | |
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