Step 1: The Materials
Processing - can be found at www.processing.org
Arduino - Can be found at www.arduino.cc
Arduino USB board (I used the Diecimila, because that's what I had)
8x LEDs of your choice
8x 330ohm resistors
Break away headers
single sided copper clad
tiny drill bit
Step 2: The Code
Once I got it all to work, it was actually very simple. Basically the Processing code will be setup like this:
myPort = new Serial(this, Serial.list()[*X*], 9600);
//some code goes here
When setting up your code make sure that your Arduino is connected to your serial port. This is important because the code is attempting to point to the specific arduino that you are using. Run your code and look at the list that will be displayed at the bottom of your Processing window and then change the variable in your code that i have indicated by the *X* to the number of the port that your arduino is connected to. Mine was the third on the list so I put 2 in place of the *X*. Keep in mind that the list is displayed as array entries, this means that the first position is indicated as 0 not 1.
The Arduino code is even simpler to setup:
I have posted the completed codes for you to take and modify and play with. The arduino is saved as pdxMap.pde and the processing code is saved as serialLEDTest.pde
Step 3: Make the Circuit Board
After I found the protoshield layout, I opened it and modified it in Eagle to what you see below. The second image is a close up of the PDF that will create the final board. There are a lot of great instructables about etching your own circuit board so i will not go over all the details here. The method that I like to use is describe beautifully in TechShopJim's instructable.
Step one: Print the PDF (found below) onto magazine paper, high gloss photo paper or a paper that is designed for PCB. Print using a laser printer. do not scale, it is layed out on a 8 1/2 by 11 piece of paper and it should print just fine with out modification
Step two: Cut out the design leaving a little bit of a boarder around the design.
Step three: Cut a piece of your copper clad that is a little bit larger then the design. the board can be cut by a bandsaw, a hack saw. But usually I will use a box cutter or Xacto knife by scoring it over and over again and then breaking it along the score line and cleaning up the edge with sand paper.
Step Four: clean the copper clad with an SOS scrub pad or steel wool until it shines, rinse it off and make sure not to touch the surface with your hands. Any grease on it will make it so the toner will not stick to the copper.
Step five: place the copper clad board onto a flat surface with the copper facing up, lay the cutout design toner side down onto the copper and tape it in place, put a paper towel over the whole thing and iron it on the the highest setting on your iron. NO STEAM! Place the iron directly on top, let the board heat up a bit before you move the iron and then take the edge of the iron and burnish the entire thing to make the toner stick to the copper. it should take about 3 min total. Remove iron and paper towel.
Step six: Soak the board in water to get the paper off. Don't be to rough while trying to take off the paper, the toner is very fragile and can easily scrape off. (If, for what ever reason it doesn't work, just take the SOS pad or steel wool to the board again and clean off any residual toner.)
Step six: Etch!
You can grab the PDF here. If you interested in the Eagle files, her is the .brd file and the .sch file
Step 4: Drill the Holes and Populate the Board
You will notice that I have created the board with the trace on the top side instead of the bottom of the board. I did that because it makes it easier to solder the headers onto the board and have it sit flat against the arduino.
I started with the resistors when populating the board. Bend the leads as close to the resistor as possible and put them into the board and solder and clip the excess leads. You can next install the headers or the LED's. The LED's have to be mounted proud of the board in order to solder them in place so I would suggest doing them last but since the component count is so low it doesn't really matter which parts are installed first.
Step 5: Load Your Sketch
Next open the processing sketch and click the play button. A window will pop up with your program running in it. By clicking in each of the red rectangles it will light up the corresponding LED on the arduino for about one second
Please feel free to post any questions or comments and post your modifications and projects, I would love to see them!