ADXL345 with Free Fall detection #1954
Replies: 9 comments
-
Posted at 2017-01-15 by ClearMemory041063 http://www.espruino.com/modules/ADXL345.js Several of the functions refer to a variable thresh, likely an abbreviation for threshold. The datasheet for the ADXL345 might help you figure it out. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-15 by ClearMemory041063 Looks like the ff function free fall is the right track.
http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf Register 0x2F—INT_MAP (R/W)
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-16 by hansamann Thx all, it looks like accel.interrupts(4,0) would enable free fall on INT1. Will try at home tonight. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-17 by hansamann So, got the latest results for my free-fall trials. It's working, but it's a tiny bit strange. The behavior is like this: I let the puck with ADXL345 fall for like 1.5 meters or so To me it looks like the interrupts are only activated once new accelerometer data is received. Would that make somehow sense? Below is the latest code for reference.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-17 by @gfwilliams Do you have it set up to automatically sample itself? I guess that'd probably be needed for the freefall detection to work, |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-17 by ClearMemory041063 Here are some things to try.
page 26
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-17 by hansamann Hi @gfwilliams, I've not set "automatic sampling" - to be honest I've got no idea. Can you point me to some sample code somewhere? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-17 by hansamann I might be wrong of course, but I was expecting the ff function to convert my values. The docs on Espruino ADXL345 mention that the values are mg. It's also kind of working, it just happends the free fall event is only triggered once the device moves again. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-17 by ClearMemory041063 Try this as the datasheet mentions that setup has to come before enable |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-15 by hansamann
I have connected puck to an external ADXL345 accelerometer and reading the values XYZ works just fine. I am now trying to detect a free fall, which seems a bit more complicated.
INT1 is connected to D30, but is never triggered. I assume my accel.interrupts call is wrong, but I cannot figure it out how to enable it correctly.
Anyone?
Beta Was this translation helpful? Give feedback.
All reactions