aboutsummaryrefslogtreecommitdiff
path: root/Arduino/LEDMatrix/LEDMatrix.pde
blob: 18a00ae836886905ac4ae8582153bfceb499db40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// test program for three cascaded AS1107
// if you got a different configuration you need to
// modify the library itself.

#include <AS1107.h>

// 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 ( )
{
  int timer = 0;

  if (Serial.read() == ((byte)108)) {
    Serial.println("L Recieved");
    while (Serial.peek() == -1) {
    }
    if (Serial.read() == ((byte)101)) {
      while (Serial.peek() == -1) {
      }
      Serial.println("E recieved");
      for (int i = 0; i < (chips*8); i++) {
        while (Serial.peek() == -1) {
        }
        buffer[i] = Serial.read();

        Serial.println(buffer[i]);

      }
      Serial.println("Buffer Recieved");


    }




  }
  matrix.Update();
}