Max7219 7segled example

Dependencies:   Max7219 mbed

Files at this revision

API Documentation at this revision

Comitter:
hotchpotch
Date:
Sat Sep 24 08:22:08 2016 +0000
Commit message:
init

Changed in this revision

Max7219.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/Max7219.lib	Sat Sep 24 08:22:08 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/hotchpotch/code/Max7219/#367abb8e4cfc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Sep 24 08:22:08 2016 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "Max7219.hpp"
+
+int main() {
+  SPI spi(D11 /* MOSI */, NC, D13 /* SCK */);
+  MAX7219 max7219(spi, D10 /* CS */);
+  max7219.begin();
+  max7219.print("-1234.567");
+  
+  wait(5);
+  double counter = 0.0f;
+  char num_str[10];
+  
+  while(1) {
+    counter += 0.01;
+    sprintf(num_str, "%9.2f", counter);
+    max7219.print(num_str);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Sep 24 08:22:08 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85
\ No newline at end of file