Accelerometer

Liam Brady

Accelerometers are specialized sensors that can measure its own rotation relative to gravity. They output the rotation data in analog form which allows for Arduinos to read it using analog input pins.

void setup() {
  Serial.begin(9600);
}

void loop() {
  int xVal = analogRead(A0);
  int yVal = analogRead(A1);
  int zVal = analogRead(A2);

  Serial.println(xVal);
  Serial.println(yVal);
  Serial.println(zVal);
  Serial.println();

  delay(300);
}