To build the electronic circuit you need the following parts:
- a 10kΩ potentiometer,
- a 1kΩ resistor,
- and a couple of wires.
The schematic for the circuit looks like this:
A potentiometer is a variable resistor. Between the two outer pins you will always measure the (maximum) value of the resistor, while the variable resistance is measure between the middle and an outer pin. That's where we connect a wire to measure the voltage. The pull-down resistor avoids a short circuit when the variable resistance is set to zero. The circuit on your breadboard should look something like this:
If everything is set up right, you can connect the board to the serial (or USB) port of your computer and, if necessary, to the power supply. The power LED should light up the next step is to export the program which reads the state of the switch to the board. Open the ap_ReadAnalog.pde file in Arduino, set the right serial port and baudrate, compile the program, and then press the reset button on your board and click on the export icon to send the program to the board.
To check if everything works fine so far, turn the potentiometer to both extremes: the LED should light up/turn off when the potentiometer reaches (approximately) its middle position. If that works fine, you can then download and unzip pa_Potentiometer.zip and open the file pa_Potentiometer.pde in Processing. You will have to set the right serial port, which you do by editing the variable portname. Eventually you will also have set the correct baudrate by editing its variable (baudrate).
Now, you can run your Processing program. A new window will open and you should see something like this:
As you turn the potentiometer the vertical bar should move as it indicates the value read from the serial port.

