Dual Digit 7 Segment Display

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
amos
Date:
Mon Oct 11 22:09:37 2010 +0000
Child:
1:4d9d638b8e3f
Commit message:
Initial connection to a dual digit 7 segment display (left digit only so far)

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	Mon Oct 11 22:09:37 2010 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+
+DigitalOut myPins[] = {p7, p8, p9, p10, p11, p12, p13};
+
+/*
+int zero[] = {0, 0, 0, 1, 0, 0, 0};
+int one[] = {0, 1, 1, 1, 1, 1, 0};
+int two[] = {1, 0, 0, 0, 0, 1, 0};
+int three[] = {0, 1, 0, 0, 0, 1, 0};
+int four[] = {0, 1, 1, 0, 1, 0, 0};
+int five[] = {0, 1, 0, 0, 0, 0, 1};
+int six[] = {0, 0, 0, 0, 0, 0, 1};
+int seven[] = {0, 1, 1, 1, 0, 1, 0};
+int eight[] = {0, 0, 0, 0, 0, 0, 0};
+int nine[] = {0, 1, 0, 0, 0, 0, 0};
+*/
+
+int numb[10][7] = {{0, 0, 0, 1, 0, 0, 0},
+                {0, 1, 1, 1, 1, 1, 0}, 
+                {1, 0, 0, 0, 0, 1, 0}, 
+                {0, 1, 0, 0, 0, 1, 0}, 
+                {0, 1, 1, 0, 1, 0, 0}, 
+                {0, 1, 0, 0, 0, 0, 1}, 
+                {0, 0, 0, 0, 0, 0, 1}, 
+                {0, 1, 1, 1, 0, 1, 0}, 
+                {0, 0, 0, 0, 0, 0, 0}, 
+                {0, 1, 0, 0, 0, 0, 0}};
+
+int main()
+{
+    for(int i = 0; i < 7; i++)
+    {
+        myPins[i] = 1;
+    }
+    while(1)
+    {
+        for(int k = 0; k < 10; k++)
+        {
+            for(int i = 0; i < 7; i++)
+            {
+                myPins[i] = numb[k][i];            
+            }
+            wait(1);
+        }
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 11 22:09:37 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e