Component used:
1.Elegoo Uno R3
2.Tilt Ball Switch
3. Female to Male DuPont wires
In this experiment, we used tilt ball to detect high and low orientation. Tilt ball sensor is a component that can detect the tilting of an object. this type of sensor is the enviromental-friendly version of a mercury switch. Tilt balls are small, inexpensive, low power and easy-to-use.
In our experiment, we have connected the black wire to the ground and the white one is to number two through tilt ball switch.
Below we can see the code

