Pages: [1]   Go Down
Author Topic: arduino leonardo and processing serial issues  (Read 1944 times)
0 Members and 1 Guest are viewing this topic.
italy
Offline Offline
Full Member
***
Karma: 2
Posts: 215
Muuuuu
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello, I have a problem communicating with my arduino leonardo.
This is the processing code:
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:

   
Code:
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
Logged

California
Offline Offline
God Member
*****
Karma: 13
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the Processing machine an WinXP?

I have the same issue on serial on a WinXP but not on Vista Machine (Have not tested Win7).
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

California
Offline Offline
God Member
*****
Karma: 13
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

California
Offline Offline
God Member
*****
Karma: 13
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


italy
Offline Offline
Full Member
***
Karma: 2
Posts: 215
Muuuuu
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the Processing machine an WinXP?

I have the same issue on serial on a WinXP but not on Vista Machine (Have not tested Win7).

I have windows 7 and it soed not work, but I have tested it on an Xp computer with the same result
Logged

Pages: [1]   Go Up
Jump to: