Error on my Processing GUI code for Arduino , I need some help

Hi @fdinumario, Looking at your original code I want to suggest something that will make shrink the code and make it easier to adjust the comms scheme.

Where you have items like this repeated

  Serial.print("rainin=");
  Serial.print(rainin, 2);
  Serial.println();

Simplify by writing a new function:

void prntValue(char label[], float value, int  nofDec)
{
   Serial.print(label);
   Serial.print(value, nofDec);
   Serial.println();
}

Now your list of sending becomes:

  prntValue("rainin="     , rainin     , 2);
  prntValue("dailyrainin=", dailyrainin, 2);

Your original code is meant to print labels and values on the serial monitor, but if you want to convert to @glv suggestion you have to alter every printing line. With the function you only have to make the changes once. You could use a function in your Processing to replace the pairs of lines

text("Rainfall:",50,350);
text(rainin,250,350);

This pays off here as well, because I think you need textAlign(LEFT) for the label and RIGHT for the value.

Serial: You need a simple definition for what the message is, and in your original the labels make things complicated. Suggest you try glv’s example and my example. It will help you to see serial comms simply working.

Please try all that and describe the remaining troubles.