// test program for three cascaded AS1107 // if you got a different configuration you need to // modify the library itself. #include // Arduino pins const byte CsnPin = 2 ; // Chip select (Low active) const byte ClkPin = 3 ; // Serial Clockq const byte DataPin = 4 ; // Serial Data const int chips = 6; byte buffer [ chips * 8 ] ; // Screen buffer (No. of modules * 8) AS1107 matrix ( CsnPin, ClkPin, DataPin ) ; const byte d = 0 ; int count= 1 ; void setup ( ) { matrix. Init ( buffer, (chips*8)-1, 7, chips -1 ) ; Serial.begin(9600); } void loop ( ) { /*buffer[0] = 127; buffer[1] = 0b10101010; buffer[2] = 0b01010101; for (int i=3; i<(chips * 8); i++) { buffer[i] = 0;//random(-128,127); // Just Green 0b10101010 } matrix.Update();*/ while (true) { int read = Serial.read(); if ((byte) read == (byte) 108) { for (int b=0; b< (chips * 8); ) { if ((read = Serial.read()) != -1) { buffer[b] = (byte) read; b++; } } break; } } matrix.Update(); }