processing controlled LEDs not working

Hey so i am making a processing controlled led "lightshow". So i am sending the LED information to arduino via a serial port, but the LEDs don't do anything. At processing i am sending information as a 9digit number. It should work like this:

Processing seperates the music in 3frequencies, maps them from 0-255, puts all the numbers together. Then arduino should seperate that in to 3 integers. Exaple:

Processing output: 050255100 Arduino: R = 50 G=255 B=100.

so each int controlls one color of the LED. I also tryed with only one LED, but it doesn't seem to work. If i write the number through the serial monitor it works fine... I am new to arduino so help is appreciated.
Arduino code:

int Red = 11;
int Blue = 6;
int Green = 9;

int Rd = 0;
int Bl = 0;
int Gr = 0;

String readstring;

void setup() {
pinMode(Red, OUTPUT);
pinMode(Green, OUTPUT);
pinMode(Blue, OUTPUT);

Serial.begin(19200);
}

void loop() {
      if(Serial.available()>0){
      readstring = Serial.readString();
      Rd = readstring.substring(0, 3).toInt();
      Gr = readstring.substring(3,6).toInt();
      Bl = readstring.substring(6,9).toInt();
     
      analogWrite(Red, Rd);
      analogWrite(Green, Gr);
      analogWrite(Blue, Bl);
    }
}

I suggest you echo back the string you received for sanity's sake. And the Rd, Gr and Bl values.

Other than that, I can't help because I don't do Strings.

KeithRB:
I suggest you echo back the string you received for sanity's sake. And the Rd, Gr and Bl values.

Other than that, I can't help because I don't do Strings.

I tried but nothing comes up.

Do you even get a "hello, world" back? You might try to toggle the LED when you get a command just to see if you are rxing anything.

Sounds like processing is not talking to your UNO.

KeithRB:
Do you even get a “hello, world” back? You might try to toggle the LED when you get a command just to see if you are rxing anything.

Sounds like processing is not talking to your UNO.

There is one strange thing… If i put a 1second delay on the loop in processing it works… And i am using arduino nano if that changes anything.

Sounds like you need to ditch the String and use Serial.read() to build up your string.

Using readString() is rarely a good idea. Using readStringUntil() is a marginally better idea. Instead of stuffing your head in the sand until the Serial class gives up hope that more data will arrive, as you are doing now, you should tell it that no more data is expected after the whatever that you pass to the function arrives. Then, when that whatever arrives, readStringUntil() will return, a whole sooner than readString() does.

Then, the useless 1 second delay won't be necessary.