A spirit level is an “an instrument designed to indicate whether a surface is horizontal (level) or vertical (plumb).” Here’s a demo by Shawon Shahryiar of an electronic spirit level made using a Microchip PIC16F684, a SCA610 accelerometer and a handful of other discrete components.
Shawon writes, “This project used a one-axis accelerometer chip and therefore, the alignment can be measured in only one direction at a time. However, the concept can be extended for simultaneous measurements of orientation in two dimensions by adding one more SCA610 sensor or just choosing a dual axis accelerometer (like ADXL202).”
Project details as well as the schematic and source code link can be found in Shawon’s article at Embedded-Lab.

The SCA610 has pretty decent sensitivity, but it costs around thirty bucks a-pop! Plus the output is analog. I think I would have chosen a different part – but maybe the Author had a SCA610 on-hand.
take an analog output and do 4 leds? better watch this: http://www.youtube.com/watch?v=IqxumHvUkWw