Taken from the book but for Newbies to compare with a Common Cathode arrangement and different HEX values for the LED's

Dependencies:   mbed

Fork of PE_03-05_SevenSegDisplay by Rob Toulson

Files at this revision

API Documentation at this revision

Comitter:
Degs
Date:
Wed Mar 13 20:59:30 2013 +0000
Parent:
0:0e32344cdb26
Commit message:
For Other Newbies Hex values of LED's

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Aug 31 15:25:02 2012 +0000
+++ b/main.cpp	Wed Mar 13 20:59:30 2013 +0000
@@ -6,22 +6,40 @@
 int main()
 {
     while(1) {
-        for(int i=0; i<4; i++) {
+        for(int i=0; i<10; i++) {
             switch (i) {
                 case 0:
-                    display = 0x3F;
+                    display = 0xC0;
                     break;       //display 0
                 case 1:
-                    display = 0x06;
+                    display = 0xF9;
                     break;       //display 1
                 case 2:
-                    display = 0x5B;
+                    display = 0xA4;
                     break;
                 case 3:
-                    display = 0x4F;
+                    display = 0xB0;
                     break;
+                case 4:
+                    display = 0x99;
+                    break; 
+                case 5:
+                    display = 0x92;
+                    break;       //display 0
+                case 6:
+                    display = 0x82;
+                    break;       //display 1
+                case 7:
+                    display = 0xF8;
+                    break;
+                case 8:
+                    display = 0x80;
+                    break;
+                case 9:
+                    display = 0x90;
+                    break;       
             }                                      //end of switch
-            wait(0.2);
+            wait(1.0);
         }                                        //end of for
     }                                          //end of while
 }                                            //end of main