Pages: [1]   Go Down
Author Topic: Send large Data packets from Processing to Arduino  (Read 741 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have problems to send Data packets from Processing to Arduino. I must transfer a two dimensional byte Array (data[25][8]) from Processing to my Arduino. By the way I have already problems to send two bytes at once. Can anybody give mi an example how to transmit large data packets?
I am really thankful for help because I try to do that now since two days without any success.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

byte[25][8] is not that much of an array, 25 * 8 = 200 bytes.

You have a choice of quite a couple of techniques depending mostly on speed vs pins vs reliability.
You can just use
shiftOut to send the data.
i2c, wire.Send.
Serial.send.


The simplest way would be to use ShiftOut, and then reading the bit when you have the click pin high.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for reply.
AT the moment I send the Data's as follows:

Code:
void geddata(void){
  Serial.flush();
  for(int x=1; x<7; x++){
    Serial.flush();
    Serial.print(x, BYTE);
    for(int i=0; i<4; i++){
      for(int k=0; k<8; k++){
        while(Serial.available()<1){
          ;
        }
        Data[((x-1)*4)+i][k]=Serial.read();
      }
    }
  }
  Serial.flush();
  Serial.print(7, BYTE);
    for(int k=0; k<8; k++){
      while(Serial.available()<1){
        ;
      }
      Data[24][k]=Serial.read();
    }
    Serial.flush();
}

The problem is that the inputbuffer seams like not to be able to manage Data's larger then 40byte, (???) otherwise they get lost somewere in the sistem. So I have to send the Data packets in 7 units what makes the transaction verry slow. It takes about 130ms for the communication that can be 20ms if it were one packet. The main problem is that i try to control a led matrix with my arduino and the datatransfer should not be longer then 41ms to have 24 frame per second.
Does anybody know something about these problem?

PS: My Arduinos are NG
Logged

Pages: [1]   Go Up
Jump to: