Go Down

Topic: Client and Server as - Processing and Arduino. (Read 590 times) previous topic - next topic

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]

I have arduino receiving this message, and it can be seen in the serial monitor with:

      char thisChar = client.read();


The message comes out as:

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.


Code: [Select]
if(thisChar = 'X'){

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

Code: [Select]
if(thisChar == 'X'){


:D! Thank you dxw00d,

I thought it might be something minor yet critical.

Go Up