mbeduino with led dice shield

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
hsgw
Date:
Sun Mar 10 10:39:51 2013 +0000
Commit message:
mbeduino with led dice shield sample.; ; sample for compare Arduino sketch and mbed program

Changed in this revision

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/main.cpp	Sun Mar 10 10:39:51 2013 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+
+int dice[7] = {0,8,65,73,85,93,119};
+
+BusOut diceLeds(p29,p21,p30,p22,p23,p11,p12);
+
+DigitalOut myled(LED1);
+
+int main() {
+    diceLeds = dice[5];
+    while(1) {
+    }
+}
+
+
+/*
+Arduino sketch example
+
+const int firstLedPin = 2;
+
+const int dice[7][7] = {
+  {0,0,0,0,0,0,0},
+  {0,0,0,1,0,0,0},
+  {1,0,0,0,0,0,1},
+  {1,0,0,1,0,0,1},
+  {1,0,1,0,1,0,1},
+  {1,0,1,1,1,0,1},
+  {1,1,1,0,1,1,1}
+};
+
+void setDice(int num){
+  for(int i=0;i<7;i++){
+    digitalWrite(firstLedPin+i,dice[num][i]);
+  }
+}
+
+void setup(){
+  for(int i=0;i<7;i++){
+    pinMode(firstLedPin+i, OUTPUT);
+  }
+  setDice(5);
+}
+
+void loop(){}
+
+
+
+*/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Mar 10 10:39:51 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b
\ No newline at end of file