I haven’t been able to find a piece of example code (both the Python and the Arduino stuff) that can reliably send and receive text and/or binary data between a PC and an Arduino. So I have written a pair of demo programs - one in Python and one for the Arduino - in the hope that they might be useful to newcomers.
I have written the programs on a Linux PC. It would be great if someone could let me know if they work on Windows and Mac systems.
I originally wrote the Python program in JRuby as I am more familiar with that. I can provide the JRuby version if anyone is interested.
Comments are very welcome.
PS. I first mentioned my interest in this thread http://forum.arduino.cc/index.php?topic=224091.0
ComArduino.py (7.79 KB)
ArduinoPC.ino (4.67 KB)