So now you have a third program.
If this post is about accelerometers, why are you including the junk reading a microphone?
sample = analogRead(MIC_PIN);
Work on just one thing at a time.
Make sure you understand how to read the accelerometer and how to interpret those readings, before adding anything else to the code.