a simple experiment with Parallax 4-direction tilt sensor (#28036). illuminate a different color LED based on the physical orientation of your project.   I am attempting to make a buoy   also makes a fun piece to a game if you rotate the part body  

Parts list:

1 Arduino Uno

1 bread board

1 4 direction tilt sensor Parralax (Product ID 28036) I bought from Microcenter

4 100Ohm resistors

4 LED(different colors)

see the the Link 4-direction tilt sensor from parallax

to figure out which way to oreintate your 6 pin sensor on bread board.


*Hint on the sensor there is text that reads "RevA" that is the up direction of the sensor. Opposite of RevA is down or gravity. 


Next wire your board according to the fritzing diagram


Upload the code I have provided to your Arduino.


you are ready to go 

works well with a battery