What is right method to pass led info from processing to arduino

The line above is correct. However, you should name it something else as g is a variable that Processing uses to manage its main sketch. It is unclear, as I am not able to run your example, if this has anything to do with your reported problem. Nevertheless, I encourage you to implement this change and continue your testing.

Additionally, Serial.list() prints all the available serial ports in your platform. I suggest you pick the right element in this array and use it while creating your Serial handler: arduinoPort = new Serial(this, Serial.list()[?], 9600 ); where ? would be the index in the array you want to use.

Finally, you can try to reduce your code to a minimal version which you could use anytime for testing purposes. This version would be as simple as outputting raw data that you receive from your arduino. No need to have controlP5 or color processing.

Kf

1 Like