Client and Server as - Processing and Arduino.
in
Core Library Questions
•
1 year ago
Hi all,
I am trying to achieve a arduino server that sends data to clients after a certain client message request.
My client sends a message GET to the server asking for some data (Processing sends this). As:
[loop function here with delay]
myClient.write("X");
I have arduino receiving this message, and it can be seen in the serial monitor with:
char thisChar = client.read();
Serial.println(thisChar);
The message comes out as:
X
X
X
etc
I am trying to apply a IF statement to the client.read(). - In arduino
For example:
if(thisChar = 'X'){
Serial.println("X received and recognised");
server.write("X recognised");
Essentially I do not have the basic knowledge to convert the client message into something arduino understands - and then can take actions on this.
If anyone could help me out in this - it would be much appreciated.
I imagine it wont be anything too crazy.
Many thanks.
I am trying to achieve a arduino server that sends data to clients after a certain client message request.
My client sends a message GET to the server asking for some data (Processing sends this). As:
[loop function here with delay]
myClient.write("X");
I have arduino receiving this message, and it can be seen in the serial monitor with:
char thisChar = client.read();
Serial.println(thisChar);
The message comes out as:
X
X
X
etc
I am trying to apply a IF statement to the client.read(). - In arduino
For example:
if(thisChar = 'X'){
Serial.println("X received and recognised");
server.write("X recognised");
Essentially I do not have the basic knowledge to convert the client message into something arduino understands - and then can take actions on this.
If anyone could help me out in this - it would be much appreciated.
I imagine it wont be anything too crazy.
Many thanks.
1