ADXL345 tap function

I was able to get the tap function working with the ADXL345 accelerometer, but not on my own. I used this person’s library and code to get started. I added some LEDs in the section the author conveniently set up at the bottom that light up when various functions are detected.

Green = inactivity
Yellow = activityPurple = tap
Blue = double tap
Red = freefall

I couldn’t get the freefall on camera. As you can see, it’s a bit finicky. When the double-tap is detected the single tap and activity are also detected. I’m a little confused as to how this actually works. Reading the datasheet I thought I would have to connect the interrupt pins, but this code works without them.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s