Arrays / Lists - Cycling74 Max - Communication with Arduino -

Hi,
I am trying to send a Max list over the serial port and read it into a array in Arduino. Unfortunately without success.
Further also the recognition of strings in Arduino
and furthermore the sending of numbers and strings from Arduino to Max are also interesting to me.
Hereby the Max Patch and the Arduino Code, that I tried to use.
Can anyone help me there?

Max_to_Arduino_Array.zip (2.71 KB)

while (Serial.available() > 0) {
    incoming = Serial.read();
    }
     for (int i = 1;i<=5;i++) {
 incoming = Serial.read();
 if (incoming != incomingold){
 LED_Werte[i] = incoming;
    }
   }
 }

First, read and throw away EVERYTHING in the buffer. Then, when the buffer is empty, read 5 more times. How on earth do you expect THAT to work?

PaulS:
First, read and throw away EVERYTHING in the buffer. Then, when the buffer is empty, read 5 more times. How on earth do you expect THAT to work?

In other words, athanas, pay close attention to the parentheses in your code.

In addition, I will not download then unzip a file.
I admit I am very lazy.
PaulS did, but I won't.
Make it easy for others to see the code with the problem, then maybe you'll get help.

.