Receiving arrays over serial at higher rates fails


hello, hello!

my project controlling adressable rgb-led strip 80 pixels via arduino on serial communication pc. "framerate" of 20-30fps desired. pc sents color data via processing, this:
code: [select]
  (int = 0; < 80;i++){
     port.write(r);
     port.write(g);
     port.write(b);  
     }

my arduino programm makes use of new readbytes() command this:
code: [select]
char colorbuff[240];

if (serial.available() >= 0){
  streamsize = serial.readbytes(colorbuff,sizeof(colorbuff));
}

after programm checks new colorbuff:
code: [select]
if (streamsize == sizeof(colorbuff){
  //write colorbuff strip , reset sreamsize 0
}


this works pretty baud rates smaller 19200, higher rates flickering, rainbow-colored mess , desired baud rate 115200 doesn´t work @ all.
so in nutshell question is: how sent array of 240 bytes arduino highest possible rate?

quote
so in nutshell question is: how sent array of 240 bytes arduino highest possible rate?

first thing consider serial buffer on arduino 128 bytes.

second thing think this:
code: [select]
if (serial.available() >= 0){
   streamsize = serial.readbytes(colorbuff,sizeof(colorbuff));

if there @ least 1 byte read, read 240 of maximum 128 characters in buffer. how's working you? never mind, answered that.



Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > Receiving arrays over serial at higher rates fails


arduino

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO