Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tkhabia committed Apr 1, 2020
1 parent 46b3e86 commit 195dcbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/AccelerometerTap/AccelerometerTap.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void setup() {
}

if (IMU.accelerationAvailable()) {
IMU.readAcceleration(xi, yi, zi); // initial values of acceleration including gravity or some zero error.
IMU.readAcceleration(xi, yi, zi); //To set initial values of acceleration, including gravity and some zero error.
}

tapThreshold = 0.05; //0.05 g acceleration in some direction is considered as tap. it can be changed for the required sensitivity.
Expand All @@ -34,7 +34,7 @@ void loop() {
if (IMU.accelerationAvailable()) {
IMU.readAcceleration(x, y, z);

// workes on difference from initial acceleration to the current acceleration
// works on the difference from initial acceleration to the current acceleration
if (x -xi > tapThreshold || x-xi < -tapThreshold){
Serial.println("Tap detected across X-axis");
}
Expand Down

0 comments on commit 195dcbc

Please sign in to comment.