Skip to content

Instantly share code, notes, and snippets.

@marcotchella
Created September 29, 2016 10:38
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 marcotchella/609c3c089d628a4c0de8c7c028ce7501 to your computer and use it in GitHub Desktop.
Save marcotchella/609c3c089d628a4c0de8c7c028ce7501 to your computer and use it in GitHub Desktop.
sketch arduino para leitura eixos do acelerometro mma7361
/*
Autor: Marco T. Chella
Em: 28/09/2016
Para saber mais:
*/
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
String vx = String (analogRead(A0));
String vy = String (analogRead(A1));
String vz = String (analogRead(A2));
Serial.println(vx + "," + vy + "," + vz);
delay(10); // delay in between reads for stability
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment