Re: ImageJ + Arduino Uno = no communications
Posted by Bill Christens-Barry on Jan 18, 2011; 5:12pm
URL: http://imagej.273.s1.nabble.com/ImageJ-Arduino-Uno-no-communications-tp3685917p3685924.html
Stephen,
Once you've identified the port for the Arduino, can you communicate with it from a terminal? If you can, then macro code I use with Mac OS 10.6.6 to suss out and converse with an mbed device might help:
print("\\Clear");
run("serial ext");
ports = Ext.ports();
print(lengthOf(ports));
indSDL = indexOf(ports, ";");
firstPort = substring(ports, 0, indSDL);
print(firstPort);
Ext.open(firstPort, 9600, "DATABITS_8 STOPBITS_1 PARITY_ODD");
for (i = 0;i < 20; i++) {
Ext.write("something" + fromCharCode(13, 10));
wait(20);
resp = Ext.read();
print(i + " something ==> " + resp);
}
Ext.close();
This code was able to print (line 7) the correct identity of an Arduino Mega just now, although the writes and reads weren't appropriate for this device.
Note that the syntax of the Ext.open() command is different from what you show, although this is downstream of identifying the device. Note also that this presumes that the Arduino shows up as the first device in the ports list; otherwise, or if you have multiple devices, you need to work through the list.
hth...
Bill Christens-Barry