Just wanted to jump in because I’ve been exploring the demos as well - Using dmiddlecamp’s fancy motion tracker, I set the Range to 2G and Click Threshold to 70 in main.ino and I believe I’m getting the behavior you are looking for. I wanted to understand why this code example was able to wake on motion the electron when I’ve had such poor luck with all the other code examples.
For background and as I understand it, the RANGE defines the max G is associated with the max value, so that 32767 is +2g of force, and -32768 is -2g when 2_G is selected.
CLICKTHRESHHOLD, on the otherhand, sets the sensitivity of the Click Detection, thru the setClick call. When a click is detected, the INT pin is pulsed high, according to how that was configured in the registered.
I found all this on:
They do a much better job in explaining in full detail how it all works and after reading their explaination, I was better able to digest the datasheet/appnote on the chip found:
I’m not on the level of rickkas7 or dmiddlecamp - but this is my current understanding. I got interested in the particle.io electron when they came out with the asset tracker kit (around the time when v0.4.x of the firmware was out was when I learned about it) but have been unable to wake up the Electron after putting it down for a power saving nap (using the official asset tracker library). Using dmiddlecamp’s example code, I now have 4 that are behaving identically, just the way I had hoped.
So what’s the difference between the two? I’m going to guess - and believe me, it is a wild guess - that the differences between the official asset tracker library and dmiddlecamp’s work is that the latter surfaces both RANGE and setClick to adjust the sensitivity where the official library does not (as far as I can tell). I am beginning to think that you need to be able to set both to fine tune the sensitivity. My second theory is that I think I read there are some controls on how the INT pin is pulled high (and for how long) and that could also be part of the problem with the official library. Those are my two guesses which I intend on exploring both libraries to see if either theory is correct. Like I said, this is all pure speculation on my part and there are many in the community that are much more knowledgeable than I am on this topic.
Hope this helps