Demonstration of SSD1308 OLED driver library

Dependencies:   mbed SSD1308_128x64_I2C

Files at this revision

API Documentation at this revision

Comitter:
wim
Date:
Sat Jul 21 12:50:23 2012 +0000
Parent:
4:83b4e905be5b
Child:
6:44256b0b5d18
Commit message:
Added comments, Added progressbar

Changed in this revision

SSD1308_128x64_I2C.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
--- a/SSD1308_128x64_I2C.lib	Wed Jul 18 14:14:19 2012 +0000
+++ b/SSD1308_128x64_I2C.lib	Sat Jul 21 12:50:23 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/wim/code/SSD1308_128x64_I2C/#300d08d9b058
+http://mbed.org/users/wim/code/SSD1308_128x64_I2C/#b7e8f5139026
--- a/main.cpp	Wed Jul 18 14:14:19 2012 +0000
+++ b/main.cpp	Sat Jul 21 12:50:23 2012 +0000
@@ -50,9 +50,7 @@
     pc.printf("C: Flip and Mirror\r");                      
     pc.printf("D: Blink\r");   
     pc.printf("E: Big Chars\r");                       
-
-//    pc.printf("E: \n\r");                                
-//    pc.printf("F: \n\r");                                    
+    pc.printf("F: Progress Scale\r");    
 //    pc.printf("\n\r");                
      
 }
@@ -284,6 +282,24 @@
                      
                      pc.printf("E: Big Chars done\n\r");
                      break;   
+                     
+          case 'F' :                     
+                     pc.printf("F: Progress Scale\n\r");
+
+                     for (int percentage=0; percentage <= 100; percentage++) { 
+                       oled.writeProgressBar(2, 0, percentage); 
+                       oled.printf(" %3d %%", percentage);                                           
+                       
+                       oled.writeProgressBar(4, 0, 100 - percentage);                        
+                       oled.printf(" %3d %%", 100 - percentage);                                                                  
+                       wait(0.05);
+                     }                   
+
+                    
+                     pc.printf("F: Progress Scale done\n\r");                   
+                     break;   
+                     
+
                                                                                        
         } //switch
       }//if