I am trying to alter an existing code that uses the device gyroscope to play an image sequence, and have it instead use the accelerometer so that the same sequence will play when the device is moved forwards/backwards instead of using rotation. Is there an easy way to do this? I'm sorry, I'm new to coding.

Here's a link to the original code.