The code presented on this page can be downloaded or found in the Arduino examples menu under Examples → SpinWearables → Tilt_Sensor → Simple
.
Ensure all of the SpinWheel hardware is on.
Read all sensor data.
Scale the x and y measurement to a -255..255 range.
Turn off all LEDs.
If the tilt is in a given direction, turn on the corresponding LED.
Do the same for the Y orientation
Turn on the LEDs as commanded above.