aboutsummaryrefslogtreecommitdiff
path: root/Arduino
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-09-12 15:50:50 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-09-12 15:50:50 +0100
commit223480547e0c3e54f729356dce80bd40d401cf79 (patch)
tree21a97738f589a6dd9850d89b4106e19764d34b11 /Arduino
parentb872e8aaf1f429d9422498cab25d5638e4158502 (diff)
downloadpunchingbag-223480547e0c3e54f729356dce80bd40d401cf79.tar
punchingbag-223480547e0c3e54f729356dce80bd40d401cf79.tar.gz
Kinda working stuff.
Diffstat (limited to 'Arduino')
-rw-r--r--Arduino/LEDMatrix/LEDMatrix.pde30
1 files changed, 17 insertions, 13 deletions
diff --git a/Arduino/LEDMatrix/LEDMatrix.pde b/Arduino/LEDMatrix/LEDMatrix.pde
index 5aada79..1a709be 100644
--- a/Arduino/LEDMatrix/LEDMatrix.pde
+++ b/Arduino/LEDMatrix/LEDMatrix.pde
@@ -24,26 +24,29 @@ void setup ( )
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();
-
- /*
+ /*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); b++) {
- buffer[b] = (byte) Serial.read();
+ for (int b=0; b< (chips * 8); ) {
+ if ((read = Serial.read()) != -1) {
+ buffer[b] = (byte) read;
+ b++;
+ }
}
break;
}
}
- matrix.Update();*/
-
+ matrix.Update();
+
}
@@ -57,3 +60,4 @@ void loop ( )
+