Add JS function for accel reading