Client and Server as - Processing and Arduino.

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().

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.

if(thisChar = 'X'){

A single equal sign is an assignment. You need the double equal sign for a comparison.

if(thisChar == 'X'){

http://arduino.cc/en/Reference/If

:D! Thank you dxw00d,

I thought it might be something minor yet critical.