Go Down

Topic: Sending a text message from processing to arduino (Read 1 time) previous topic - next topic

roOmanoO41

Apr 08, 2013, 03:07 pm Last Edit: Apr 08, 2013, 03:36 pm by roOmanoO41 Reason: 1
Hello,

I'm French, so I apologize if I don't express myself correctly.
My problem is that I can't see if Arduino receive the messages I'm sending with processing :
I want Arduino to read the letters I'm sending from processing but I don't know how
Here are my programs


Arduino code
Code: [Select]
int incomingbyte = 0;

void setup() {
Serial.begin(9600); // ouvre le port série et fixe le debit de communication à 9600 bauds
}

void loop() {
 
 if (Serial.available() > 0) { // si des données entrantes sont présentes, on lit le 1er octet
     incomingbyte = Serial.read();
     Serial.write(incomingbyte);
     delay(20);
     Serial.print (incomingbyte);
     delay(3000);
 }
 else  {
      Serial.print("Aucune donnée recue");
      delay(10000);
    }
 
}


Thanks

PaulS

That Processing code is a mess. There are useless { and } throughout the code. There is code that is commented out. That code clearly has nothing to do with your problem, so why did you post it? Delete it!

Use Sketch + Auto Format to properly indent the code, and put every (necessary) { on a new line.

The Arduino is responding to serial data from Processing, but Processing ignores any serial data coming in. Why?

roOmanoO41

What do you mean ? I can check if my data's are sent with Processing or Arduino ?

PaulS

How do you determine if someone has replied to your post? You read the forum, and see that there is a reply. Well, you are the Processing application, sending a text message to the forum.

I'm the Arduino application, reading your post, and sending a reply.

You, the Processing application, can read what I sent, or not. It's up to you. But, if you want to know what I sent, you really need to read it.

roOmanoO41

#4
Apr 08, 2013, 04:20 pm Last Edit: Apr 08, 2013, 05:42 pm by roOmanoO41 Reason: 1
I understand what you mean, I thought I could see it with  the serial monitor but I will try to check with processing, thank you.

EDIT : How can i read the data's which are sent to Arduino with Processing ? is there a function for Processing like Serial.read ?

Zaplady


I understand what you mean, I thought I could see it with  the serial monitor but I will try to check with processing, thank you.

EDIT : How can i read the data's which are sent to Arduino with Processing ? is there a function for Processing like Serial.read ?

Hi
It is done with a library in Processing:

http://processing.org/reference/libraries/serial/index.html

The commands are remarkably similar to those on the Arduino.

Mrs Z

Go Up