I am running a continuous programme using an accelerometer and an mbed. So as not to overload the mbed I only want to record data when there is a fluctuation in reading. For example, if the accelerometer moves at 2am it records 20 readings over say 10 seconds, and then stop recording data until the next movement.