SSD1306 LCD 96x16 model

Dependents:   testSoftware8_alles_display

Fork of ssd1306_library by Miguel Angel Rodriguez Jodar

Revision:
12:42a98fa363b4
Parent:
11:1b5a69808460
Child:
13:e52c5cb758ca
--- a/ssd1306.cpp	Thu Aug 09 12:41:15 2018 +0000
+++ b/ssd1306.cpp	Wed Sep 12 11:09:35 2018 +0000
@@ -343,9 +343,9 @@
                                          0x80, SSD1306_SEGREMAP | 0x1,
                                          0x80, SSD1306_COMSCANDEC,
                                          0x80, SSD1306_SETCOMPINS,
-                                         0x80, 0x02, 
+                                         0x80, 0x00, 
                                          0x80, SSD1306_SETCONTRAST, 
-                                         0x80, 0xFF, 
+                                         0x80, 0xFF,
                                          0x80, SSD1306_SETPRECHARGE,
                                          0x80, 0xF1,
                                          0x80, SSD1306_SETVCOMDETECT,
@@ -358,53 +358,6 @@
     return bus->write (ssd1306_i2c_addr, comando, sizeof comando);
 }
 
-
-//    static const char comando[] = {0x80, SSD1306_DISPLAYOFF, 
-//                                         0x80, SSD1306_CHARGEPUMP, 
-//                                         0x80, 0x14, 
-//                                         0x80, SSD1306_MEMORYMODE,
-//                                         0x80, 0x00,
-//                                         0x80, SSD1306_SETMULTIPLEX,
-//                                         0x80, 0x0F,
-//                                         0x80, SSD1306_SETDISPLAYOFFSET,
-//                                         0x80, 0x00,
-//                                         0x80, SSD1306_SETDISPLAYCLOCKDIV,
-//                                         0x80, 0x80,
-//                                         0x80, SSD1306_SETSTARTLINE,
-//                                         0x80, SSD1306_SETCOLUMNADRESS,
-//                                         0x80, 0x00,
-//                                         0x80, 0x60,
-//                                         0x80, SSD1306_SETPAGEADRESS,
-//                                         0x80, 0x00,
-//                                         0x80, 0x01,
-//                                         0x80, 0x41,
-//                                         0x80, SSD1306_SEGREMAP | 0x1,
-//                                         0x80, 0x2E,
-//                                         0x80, SSD1306_COMSCANDEC, 
-//                                         0x80, SSD1306_SETCONTRAST, 
-//                                         0x80, 0x7F, 
-//                                         0x00, SSD1306_DISPLAYON
-//                                  };
-
-//    static const char comando[] = {0x80, SSD1306_DISPLAYOFF, 
-//                                         0x80, SSD1306_CHARGEPUMP, 
-//                                         0x80, 0x14, 
-//                                         0x80, SSD1306_MEMORYMODE,
-//                                         0x80, SSD1306_SETMULTIPLEX,
-//                                         0x80, 0x00, 
-//                                         0x80, 0x00,
-//                                         0x80, SSD1306_SEGREMAP | 0x1,
-//                                   0x80, SSD1306_COMSCANDEC, 
-//                                         0x80, SSD1306_SETCONTRAST, 
-//                                         0x80, 0x7F, 
-//                                         0x00, SSD1306_DISPLAYON
-//                                  };
-//
-
-
-
-
-
 void SSD1306::scroll (bool refresh)
 {
     int i;
@@ -492,42 +445,20 @@
 void SSD1306::cls (char *bkground, bool refresh)
 {
     int i;
-    static int refreshD = 0 ;
-    if (!bkground) {
-        for (i=0; i<196; i++)
-        {
-            if ( refreshD == 0 )
-            {
-                //fb[i] = 0xFF ; //0x81; 
-            }
-            else 
-            {
-                fb[i] = 0x00 ; //0x81;
-            }
-        }
-    } else {
-        
+    if (!bkground) 
+    {
         for (i=0; i<196; i++)
         {
-            if ( refreshD == 0 )
-            {
-                //fb[i] = 0xFF ; //0x81;             
-            }
-            else 
-            {
-                fb[i] = 0x00 ; //0x81; 
-            }        
+            fb[i] = 0x00 ; //0x81; 
         }
-    }
-        if ( refreshD == 1 ) 
+    } 
+    else 
+    {  
+        for (i=0; i<196; i++)
         {
-            refreshD = 0 ;    
+            fb[i] = 0x00 ; //FF ; //0x81;             
         }
-        else 
-        {
-            refreshD = 1; 
-        }
-    
+    }    
     idxfb = 0;
     if (refresh)
         redraw();