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

at first i load the code you linked to
and it does work
( sorry i just had a arduino leonardo connected. )

meaning it understands one integer number send with [enter]
it could take 32 bytes but that would be a much too big int

On the Arduino Uno (and other ATmega based boards) an int stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1).

so what you try to do?
why you change to 4 bytes?
why i not see what you send and what it understands?
did you send one line or 4 lines?

if you need 4 number to send best way would be
199,299,399,499[enter]
( i call that a CSV line )
and you need arduino code to understand that.

  • split on ‘,’
  • 4 times atoi

if you want send separate lines need identifier
n999[enter]
R199[enter]
G299[enter]
B399[enter]
split on first char and identify n ,R, G, B
atoi rest of string.

i will load your code later to understand it.

1 Like