I wonder if you have attached an early version of the code. It doesn't read a button, doesn't do anything with the accelerometer values and just unconditionally toggles the outputs about five times a second.
While this is arguably the right place for this topic, you might consider asking a moderator to move it to "Project Guidance" - there's a lot more folks reading topics there.