hello, I have a problem communicating with my arduino leonardo.
This is the processing code:
import processing.serial.*;
Serial myPort; // Create object from Serial class
int val; // Data received from the serial port
void setup()
{
size(200, 200);
// I know that the first port in the serial list on my mac
// is always my FTDI adaptor, so I open Serial.list()[0].
// On Windows machines, this generally opens COM1.
// Open whatever port is the one you're using.
String portName = Serial.list()[1];
println(Serial.list());
myPort = new Serial(this, portName, 9600);
}
void draw()
{
if ( myPort.available() > 0) { // If data is available,
val = myPort.read(); // read it and store it in val
print((char) val);
}
}
and this is the arduino one:
void setup() {
Serial.begin(9600); // Start serial communication at 9600 bps
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
}
void loop() {
delay(1000);
Serial.print("hoila "); // send to Processing
delay(1000);
Serial.print("hoibo "); // send to Processing
}
I receive all char if I use another arduino (not leonardo), or anoter serial terminal with leonardo, but with arduino leo and processing connected on the serial port nothing is read.
Do you have any idea?
thanks in advance
I'm having the same issue but trying to interface with a vb.net application. I can send data to the Leonardo fine (and the Leonardo can read it) but when I try to make the Leonardo send anything back I never can get it to fire any kind of data received function in vb.net. The code I've been toying with works fine on an UNO though.
Yeah, I even did a Hot Fix to update the usbser.sys... no change. I am curious on how cantore got it to output in another terminal program. I tried teraserv and hyperterm...no joy. cantore has success w/ Win7 and I did with Vista.
spcomputing:
Yeah, I even did a Hot Fix to update the usbser.sys... no change. I am curious on how cantore got it to output in another terminal program. I tried teraserv and hyperterm...no joy. cantore has success w/ Win7 and I did with Vista.
Can you get it to receive messages from the computer, just not send any that the computer can catch or are you not getting anything at all either direction?
I can get it to actually receive a sketch. I have sent the "fade" sketch switching from D9 to D13 and it works perfectly. If I try to read anything from the serial communications on USB I get nothing. If I move the Leonardo to a Vista machine and just open the serial monitor, it spews all kinds of data.
I know this is an old topic, but I hope you can help me. I am trying to send from arduino Leonardo to Visual Studio and I can't get it to work. All your problems describe everything i have.
Visual Studio is an application for developing applications. It does NOT listen to the serial port. You can develop an application, using Visual Studio, that does listen to the serial port. What have you developed?