aboutsummaryrefslogtreecommitdiff
path: root/Arduino/LEDMatrix/LEDMatrix.pde
diff options
context:
space:
mode:
authorAdam Martindale <awiamartindale@googlemail.com>2011-09-07 11:31:02 +0100
committerAdam Martindale <awiamartindale@googlemail.com>2011-09-07 11:31:02 +0100
commitcd0fdd04f3108f61482919309b2a2da5c33f6872 (patch)
tree99710b299a02fa58382df101766892c0c3b679a7 /Arduino/LEDMatrix/LEDMatrix.pde
parentdc16d95ed5a4b5f15f327cbe609414dc9e5d6225 (diff)
parentba3448fb8093afd9d298cef1123a1bedfea13999 (diff)
downloadpunchingbag-cd0fdd04f3108f61482919309b2a2da5c33f6872.tar
punchingbag-cd0fdd04f3108f61482919309b2a2da5c33f6872.tar.gz
Merge branch 'master' of gitorious.org:punchingbag/punchingbag
Diffstat (limited to 'Arduino/LEDMatrix/LEDMatrix.pde')
-rw-r--r--Arduino/LEDMatrix/LEDMatrix.pde34
1 files changed, 34 insertions, 0 deletions
diff --git a/Arduino/LEDMatrix/LEDMatrix.pde b/Arduino/LEDMatrix/LEDMatrix.pde
new file mode 100644
index 0000000..0d3994b
--- /dev/null
+++ b/Arduino/LEDMatrix/LEDMatrix.pde
@@ -0,0 +1,34 @@
+// 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
+
+byte buffer [ 8 ] ; // Screen buffer (No. of modules * 8)
+AS1107 matrix ( CsnPin, ClkPin, DataPin ) ;
+
+const byte d = 0 ;
+int count= 1 ;
+void setup ( )
+{
+ matrix. Init ( buffer, 7, 7, 0 ) ;
+}
+
+void loop ( )
+{
+ for (int x=0; x<8; x++) {
+ for (int y=0; y<8; y++) {
+ matrix.SetLed(x,y,1);
+ matrix.Update();
+ delay(1000);
+ matrix.SetLed(x,y,0);
+ matrix.Update();
+ delay(1000);
+ }
+ }
+}