I got my MMA8452Q Accelerometer up and running, now I want to edit the example code it came with. I want to make it so it will give power to certain pins when I tilt it in different directions. For example, when I turn it to the right, pin 2 will give power, and when I turn it to the left, pin 3 will. Like that but for forward, backward, and side to side. How can I do that?
https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/example-code