Go Down

Topic: array help (Read 1 time) previous topic - next topic

greyskale

I'm not sure this is the issue... within my serialListen() method, if(Serial.available()){ is first, so technically if serial is not available, it should just continue down the line. for example, I tried it from another angle

Code: [Select]

void serialListen()
{
 if(Serial.available()){
   dataArray[index] = Serial.read();
   index++;
 }
 if(index >= 8){
   index = 0;
 }
}


this allows me to send groups of 8 bytes at a time to my array and update the array without the while loop. however it seems to fall out of sync (can't really think of a better way to describe it) and the sprite drawn on the matrix can come out of center vertically... so though I can now update the display (play small animations etc) I still havn't been able to sort this out.
there are 10 types of people in this world, those who can read binary and those who can't.

kg4wsv

looks OK at a glance, are you sure you're receiving the data properly, no extra carriage returns or line feeds or anything?

-j

greyskale

yeah... just sending an array of bytes one by one. It seems ok now for some reason though. not sure what the issue was, but today it seems to like me better  ;).
there are 10 types of people in this world, those who can read binary and those who can't.

Go Up