ok now i got something like this:
//arduino
if(Serial.available()){
switch (Serial.available()){
case 'r':
col[0] = Serial.read();
break;
case 'b':
col[1] = Serial.read();
break;
}
}
//processing
Arduino.write('b');
Arduino.write(mouseX + 3);
Arduino.write('r');
Arduino.write(mouseY + 3);
with the result that I get the blue LED to flicker, but the red one isn't on at all.
hmm in my mind this code makes sense >.<
if receive "b"
receive next value as blue
if receive "r"
receive next value as red
something like:
R(val)B(val)R(val)B(val)R(val)B(val)
regards