Here is a working example. I hesitated to post all the code, because it is better when you can put it together and understand what it does. It can be difficult to edit this to do what you want to do if you do not know how to do it. I tried to comment what I could.
Although this does not look like this, I started with Justin's example. I thought it was worth mentioning.
Click on the sensor to increase pressure, acceleration, etc.
http://jsfiddle.net/JdLUw/
Conclusion:

source share