Hmm how should I use the for-loop?
Because if I send the whole array, how do I know when I got the first, and when the second number?
If I send them just one line after the other, they will be stored in the same variable.
Using a for loop like this, nothing will happen.
//arduino
if(Serial.available()){
for(int i = 0; i > 1; i++){
col[i] = Serial.read();
}
}
//processing
Arduino.write(col[0]);
Arduino.write(col[1]);
Want I need is some way to say:
- byte = red
- byte = green
- byte = blue
(1.)4. byte = red
(2.)5. byte = green
(3.)6. byte = blue
and all I get is:
- byte + 2. byte = red
no byte for green...
regards
p.s.
I'm familiar with the Serial commands, I just lack the knowledge on how to integrate them into what I want to do.
p.p.s.
I somehow can't find a decent example where a larger amount of data is sent to arduino (which should suffice for gettinge the idea), only vice versa.