Pages: [1]   Go Down
Author Topic: Sending a text message from processing to arduino  (Read 971 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
« Last Edit: April 08, 2013, 08:36:52 am by roOmanoO41 » Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 615
Posts: 49388
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 615
Posts: 49388
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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 ?
« Last Edit: April 08, 2013, 10:42:04 am by roOmanoO41 » Logged

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

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
Logged

Pages: [1]   Go Up
Jump to: