Arduino sketch for transient detection using Freescale MMA8452Q