but i cant even make a succesful sketch to make an led turn on the baord, i dont know what barebones code i need to write!
and how do i tell it my port is com 3?
and what do i use instead of "digitalWrite" and instead of "pinMode"
and instead of "HIGH" and instead of "OUTPUT" becuase for all those things it sais it's not located in some temporary folder on my comp...
i'm also trying to edit your code to work with, but its not working either, are those port. commands neccasery, or do i just get rid of them?
thnks for the quick reply btw!!
OK - first of all, you know that processing and arduino are two different programs, and each has a specific and totally different purpose?
To make and Arduino board respond to processing commands, you need to write TWO DIFFERENT sketches - one in the Arduino IDE, compiled and then uploaded to the Arduino board, and another written in the Processing IDE, and then run on your PC.
To do what you are trying to do, the framework of the processing sketch will look like what I posted. The arduino sketch will look like a typical Arduino sketch that you are used to - it will have the digitalWrite() and pinMode() calls.
In regards to your specific question about the processing sketch, the line
println(Serial.list()); // What serial ports are avaialble?
will output the available serial ports to the black area at the bottom of the Processig IDE. You use the number corresponding to COM3 in the list in the next line. Also, the number will be the same as the position (zero indexed) COM3 appears in the TOOLS -> Serial Port list in the Arduino IDE, i.e. if it's the third on the list, you should use .
In general, it sounds like you are trying to jump into things too quickly, and then getting frustrated when it doesn't work. I used to do excactly the same thing, and I don't know whether it's getting older, doing more projects, or doing engineering work as a job that has made me realise that knowing what you are doing first makes the job a lot easier.
Start with reading ALL the reference sections of the Arduino website - it really is a valuable resource. Equally (or perhaps more) valuable are the example sketches, and I think you are lucky, beacuse there is an example which has both an Arduino sketch and Processing sketch which does almost exactly what you are trying to do, although rather than lighting and LED when a certain key is pressed on the computer, it lights up when the mouse rolls over an area on the screen.
You can find the example (at least on Arduino 0008 - might change for other versions, I'm not sure) in the Arduino IDE by going
FILE -> Sketchbook - > Examples -> Communication -> Physical Pixel
Note the Arduino code is at the top, the Processing code is below, and commented out. You can copy out the processing code into a new processing sketch, or you can simply open it as an example in processing by going
FILE -> Examples -> Libraries -> Serial -> SimpleWrite
See how easy they have made it for you!
So play around with the example, then do a FILE -> Save As for both, and modifiy the Processing skecth so that it sends out the key you press, and modify the Arduino sketch to listen to what it receives over the serial line, and lights up an LED according to what key it was.
Feel free to ask questions, but it makes it easier on everyone if it's obvious you've read all the help, reference and examples.