RasPiSamples, more specifically to JoyStickAndServos.java
The goal here is to read analog data produced by a joystick from a Java program running on a Raspberry PI.
For this example, we will be using a joystick like this one.
We will reuse the setting of the ADC sample (using SPI bus). Instead of reading the potentiometer
on one ADC channel, we will use the two analog channels (Up/Down and Left/Right) from the joystick. Those two outputs are - by the way - two potentiometers.
In addition, we will use those data from the joystick to drive two standard servos, as explained in the servo section.