work out what a normal variation in the readings would be(sensitivity). as in if you left it untouched, what the range of readings would be.
then simply take that range, if you get a larger change than said range on any of the axies set the alarm off.
so
if (abs(last reading - current reading)>sensitivity)
alarm =1;
abs give the value, ignoring the sign so abs(-1) = abs(1);
this implementation is crude, and prone to randomly setting itself off. a better implementation would take into account a range of readings streching back in time. of course, most of the fun is in working that out.
Hello All Again,
I've had a previous post about the installation of the ADXL345, and have gotten it to work, but now need help in the method that I will be able use the conditional statements.
So far: