Author Topic: Accelerometer Events  (Read 734 times)

Nick_W

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: Accelerometer Events
« on: September 17, 2016, 07:08:55 pm »
That code doesn't work for taps.

I have posted a door knock sensor, which has a working tap detector in it, with a totally re-written mma8652 library.

Hopefully you can adapt my code.

Search for "where I'm keeping my code" on these forums for a link to my GitHub.

Edit: here is the link https://github.com/NickWaterton/mcScript

Look for doorsensor under projects. This need the re-written mma8652 library, the tempSensor library, and my MQTT library.

This detects a "knock" (two small taps, less than 0.75 seconds apart works) when the door is closed (use a magnet next to the reedswitch to simulate a door being closed).

10 seconds after the door closes, the knock sensor arms.

Events are published to MCThings/# this will show all events. Events are also encoded in the device beacons, you can receive them using beacon_decode.py, but you don't need this for the basic functionality.

This is tuned to door knocks, so there is a lot of timing in there that you might not need.

The transient sensor set up works, and you can specify force (in g) and duration (in ms). When triggered, it generates a "knock" event.

Good luck,
 
« Last Edit: September 17, 2016, 08:23:10 pm by Nick_W »
Like Like x 1 View List