Arduino + Lego NXT

The tilt is measured by a gyroscope (Epson).
The gyroscope tells angular speed so integration is needed to obtain actual angle.

Datasheet(s):
http://ndap3-net.ebz.epson.co.jp/w/www/PDFS/epdoc_qd.nsf/f5af260ddc5fb8ed49256a9c001d58b2/6c3c798debd98cfe492571f1000ff2dc/$FILE/XV-8100_E082.pdf
http://www.epsontoyocom.co.jp/english/product/Sensor/set01/xv8100cb/index.html