Test code for SDA5708 LED matrix display

Dependencies:   SDA5708 mbed

Files at this revision

API Documentation at this revision

Comitter:
wim
Date:
Mon Sep 29 19:45:23 2014 +0000
Child:
1:bffa08157551
Commit message:
First release.

Changed in this revision

SDA5708.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDA5708.lib	Mon Sep 29 19:45:23 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/wim/code/SDA5708/#5265413226e5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 29 19:45:23 2014 +0000
@@ -0,0 +1,60 @@
+
+#include "mbed.h"
+#include "SDA5708.h"
+
+// mbed Interface Hardware definitions
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut heartbeatLED(LED4);
+
+// Host PC Communication channels
+Serial pc(USBTX, USBRX);
+
+// SPI Communication
+SPI spi_led(p5, NC, p7); // MOSI, MISO, SCLK
+
+//Display
+SDA5708 led(&spi_led, p8, p9); // SPI bus, CS pin, RST pin
+
+// Variables for Heartbeat and Status monitoring
+Ticker heartbeat;
+bool heartbeatflag=false;
+
+// Heartbeat monitor
+void pulse() {
+  heartbeatLED = !heartbeatLED;
+}
+
+void heartbeat_start() {
+  heartbeat.attach(&pulse, 0.5);
+  heartbeatflag = true;
+}
+
+void heartbeat_stop() {
+  heartbeat.detach();
+  heartbeatflag = false;
+}
+
+int main() {
+  int cnt;
+  
+  heartbeat_start();
+
+  led.locate(0, 0);                               
+
+//led.printf("*=%6d", 123456);
+//            12345678 
+  led.printf("Hi mbed ");  
+  wait(2);
+  
+  cnt=0x20;  
+  while(1) {
+    wait(0.5);
+                        
+    led.putc(cnt);
+    cnt++;
+    if (cnt == 0x80) cnt=0x20;
+  }
+  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 29 19:45:23 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file