hi, i tried posting for help on the processing forum, but nobody is answering!processing looks cool, and i just want to be able to use it!

so if somebody could show me the barebones of what i need in my coding screen, and include anything the processing program needs to connect to the arduino, becuase im having problems.

please include

begining, void setup, void draw or loop, whichever i need, and if you need an actual script to use, im tryng to make it so when i press b on my keyboard, the arduino understands and turns an led on, and the led is on pin 13.

port.write(hour()); //Send the hours as a two digit number delay(100); port.write(minute()); //Send the minutes as a two digit number delay(100); port.write(second()); //Send the seconds as a two digit number}

void draw() { // I just needed to send the time once, didn't need to do anything after that so draw() is empty}

You'll need to change a few things - you'll want to move the port.write calls to the draw() function for example.

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?

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

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 [2].

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.

and then i programmed glovepie (with a code thats shorter then my name lol ) and now when i press A on my wiimote, and led lights up on the arduino!IT WORKED!!!awsome, thanks for the help, i wouldent have been able to do it without your help, and now i could move onto more complex things, i could even make a wiimote controlled robotthanks again!-big93