In this project, we will use Arduino to get signal from tilt sensor. When sensor is tilt, Arduino will turon LED otherwise the LED will turn off.
2)Devices and parts：
Arduino UNO R3 x 1；
USB cable x 1；
Tilt switch sensor x 1；
4)Download sample code from following link:
Load above code into Arduino IDE and you will see result as following:
Tilt the sensor in some angle, LED is on. see following picture: