bmthomsen
12-02-2009, 03:22 PM
Hi, I'm working on a class project that involves using this accelerometer. We have·the sensor·set up inside a foam ball, mounted on a large spring, which is bolted to a tire rim. The idea is to hit the ball, and·have·different LEDs and music play according to·the maximum acceleration detected by the sensor. We were able to get the sensor·working properly, but I have not been able to figure out a way to get the Stamp to monitor the acceleration variable that the sensor feeds data into, and detect the peak acceleration generated from the ball being hit. I am hoping someone can give me some ideas or point me in the right direction on what the logic would look like to do something like this.
Here is specifically what needs to happen:
The sensor's acceleration variable is updated constantly with new acceleration values (we're only interested in the X axis acceleration).
The sensor can output a max value·of 127, equal to 8g. When it is standing still, it varies from -10 to 10 or so, so the program needs to disregard anything below ~30. The program needs to monitor this variable and watch for it to rise. As soon as the acceleration comes to a peak and starts to decelerate, we need this peak acceleration value to be written to another variable, so we can use it to turn on LEDs and other things.
I'm including a StampPlot graph of what the data looks like when the ball takes a hit. I appreciate any ideas anyone has to offer.
thx, BMT
Here is specifically what needs to happen:
The sensor's acceleration variable is updated constantly with new acceleration values (we're only interested in the X axis acceleration).
The sensor can output a max value·of 127, equal to 8g. When it is standing still, it varies from -10 to 10 or so, so the program needs to disregard anything below ~30. The program needs to monitor this variable and watch for it to rise. As soon as the acceleration comes to a peak and starts to decelerate, we need this peak acceleration value to be written to another variable, so we can use it to turn on LEDs and other things.
I'm including a StampPlot graph of what the data looks like when the ball takes a hit. I appreciate any ideas anyone has to offer.
thx, BMT