To build the electronic circuit you need the following parts:
- a multiple (here 8) switch element,
- as many 1kΩ resistor as switches (here 8),
- and a bunch of wires.
The schematic for the circuit looks like this:
The multiple switch element has two pins for each switch between which the connection is closed when the corresponding switch is in ON position. The circuit we build is simply a multiplication of the single switch circuit. We connect all the pins on one side of the element to 5V and the pins on the other side are connected to a 1kΩ resistor each that leads to ground. To measure the state of each switch we connect a wire on the resistor side to a pin (here we are using pins 3-10) on the Arduino board. 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 and the next step is to export the program which reads the state of the switch to the board. Open the ap_ReadMultiDigital_8.pde file in Arduino, set the right serial port and baudrate, compile the program, 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, see if the control LED lights up when switch #1 (connected to pin 3) is in ON-position. Now, you can download and unzip pa_8Switches.zip and open the file pa_8Switches.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:
Each of the numbers represents one switch. The number for each switch will float to the top as long as the switch is ON, if it's OFF the corresponding number will float down. Try this out by changing the switches while the program is running.

