?I've been working on this project for some time now and I'm at a point where the thing works, but it is not always reliable.?I have MAX sending a string of ASCII representing RGB values to arduino. Arduino then unpacks this string and assigns the values to PWM pins 9, 10 and 11 to mix color using a high-powered RGB LED. I have been able to do this, but am noticing that every so often I get a color flicker in from the LED. It is almost as if every so often a value in the string is assigned to the wrong pin. It feels like a slip up in assigning values, 70% of the time things work quite well.

Attached are the MSP and Arduino files. Please let me know if you have any suggestions.?

char greenLed[4]; //create a string to hold the value for the red part of the stringNo, wait, you're storing the red data in greenLed.

If you are going to have useless comments, they should at least be correct.

The real problem, though, seems to be that you have a start byte but no end byte. Why not? Reading properly delimited data (and using strtok() to parse it) is much simpler than hoping all the data arrives in the correct order.

I appreciate your input. I am looking into strtok() for dealing with the string.

I learnt that there is a certain percentage of error when sending data strings through serial and that the best way to handle that is to write a portion of code to ignore the faulty string. What do you reckon? I wish I could view serial data sent from Max MSP and received by Arduino at the same time.

Thanks for pointing out that mix up in the comments. I'm not sure why you think those comments are useless though. I find them quite helpful, those ones specifically . . . .