SG12864A

Dependents:   SG12864A_TestProgram

Revision:
3:86e7fba29623
Parent:
2:91c03e41c927
Child:
4:200d1ea4e76e
--- a/main.cpp	Tue Jul 20 05:30:47 2010 +0000
+++ b/main.cpp	Tue Jul 20 07:23:15 2010 +0000
@@ -41,28 +41,73 @@
 #else
     lcd.clear();
     lcd.reset();
+    bool reverse = false;
     while (1) {
         //
-        lcd.bufferClear();
-        lcd.bufferDrawLine(0, 0, SG12864A::PIXEL_X - 1, SG12864A::PIXEL_Y - 1);
-        lcd.bufferDrawLine(0, SG12864A::PIXEL_Y - 1, SG12864A::PIXEL_X - 1, 0);
-        lcd.bufferDrawString(1, 1, "This is a test #1.\b");
+        lcd.bufferClear(reverse);
+        lcd.bufferDrawLine(0, 0, SG12864A::PIXEL_X - 1, SG12864A::PIXEL_Y - 1, reverse);
+        lcd.bufferDrawLine(0, SG12864A::PIXEL_Y - 1, SG12864A::PIXEL_X - 1, 0, reverse);
+        lcd.bufferDrawString(1, 1, "This is a test #1.\b", reverse);
+        lcd.bufferDrawCheckbox(50, 50, 60, 60, true, reverse);
         lcd.bufferPush();
         wait_ms(1000);
 
         //
-        lcd.bufferClear();
-        lcd.bufferDrawBox(0, 0, SG12864A::PIXEL_X - 1, SG12864A::PIXEL_Y - 1);
-        lcd.bufferDrawString(1, 2, "This is a test #2.\b");
+        lcd.bufferClear(reverse);
+        lcd.bufferDrawBox(0, 0, SG12864A::PIXEL_X - 1, SG12864A::PIXEL_Y - 1, reverse);
+        lcd.bufferDrawString(1, 2, "This is a test #2.\b", reverse);
+        lcd.bufferDrawCheckbox(50, 50, 60, 60, false, reverse);
         lcd.bufferPush();
         wait_ms(1000);
 
+#if 0
         //
-        lcd.bufferClear();
-        lcd.bufferFillBox(0, 0, SG12864A::PIXEL_X - 1, SG12864A::PIXEL_Y - 1);
-        lcd.bufferDrawString(1, 3, "This is a test #3.\b");
+        lcd.bufferClear(reverse);
+        lcd.bufferFillBox(0, 0, SG12864A::PIXEL_X - 1, SG12864A::PIXEL_Y - 1, reverse);
+        lcd.bufferDrawString(1, 3, "This is a test #3.\b", reverse);
+        lcd.bufferDrawCheckbox(50, 50, 60, 60, true, reverse);
         lcd.bufferPush();
         wait_ms(1000);
+#endif
+
+        //
+        {
+            lcd.bufferClear(reverse);
+            int min = 0;
+            int max = 100;
+            for (int i = min; i <= max; i++) {
+                lcd.bufferDrawProgressbar(10, 10, 118, 20, min, max, i, true, reverse);
+                lcd.bufferPush();
+                wait_ms(2);
+            }
+        }
+
+        //
+        {
+            lcd.bufferClear(reverse);
+            int min = -100;
+            int max = 100;
+            for (int i = min; i <= max; i++) {
+                lcd.bufferDrawProgressbar(10, 10, 118, 20, min, max, i, true, reverse);
+                lcd.bufferPush();
+                wait_ms(2);
+            }
+        }
+
+        //
+        {
+            lcd.bufferClear(reverse);
+            int min = 100;
+            int max = 600;
+            for (int i = min; i <= max; i++) {
+                lcd.bufferDrawProgressbar(10, 10, 118, 20, min, max, i, true, reverse);
+                lcd.bufferPush();
+                wait_ms(2);
+            }
+        }
+
+        //
+        reverse = !reverse;
     }
 #endif
 }