Let's Make Robots!

2 way instructions: Arduino to PC and back again

Ahoy hoy. Back again. had a break of a week to have a play with processing, but now im BACK. i can hear the collective sigh of relief (or was it exasperation)

I have struggled to find a nice simple serial tutorial, for making processing talk to an arduino and back again (via a cable)

I am looking to do the following process:

Connect (obviously, i kind of understand the "handshake" procedure required)

Transmit a value, between 0 and 255, to the arduino.

have the arduino deal with the data, and respond that it is ready for the next value (send back a signal of some sort)

I also want to be able to send instructions from the PC, in addition to the values. ideally (in my mind) they would be in text format eg: "End" but i realise this may complicate things, so i might be better going for a single ascii character? "A" or "X"

If anyone knows of a good example, and could point me in the right direction, or summarise the sketch for both ends of the setup it would be greatly appreciated!



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

My my this is frustrating.

Having not had my code working, i stripped it back to a super simple version of my code, which didnt work.

then loaded the example from the serialcallresponse tutorial, which ALSO doesnt work, despite copy and paste. Which means (as far as i can see) that after all that, it is a problem with processing and the arduino mixing up the serial ports.

needless to say, not best pleased :(

I was using the appropriate ide for each part, but i did have both ides open while trying to get it to work. I will try your suggestion birdmun. Is there a serial window in the processing one? Or is it just presented in the black box at the bottom(as i have noticed it does when looking up the the port list)