Basic driver working

Revision:
81:7087ba9d18bb
Parent:
80:ff42f77928ad
--- a/main.cpp	Wed Feb 03 11:30:30 2021 +0000
+++ b/main.cpp	Sat Feb 20 16:34:49 2021 +0000
@@ -11,7 +11,8 @@
 #define LED_ON      0
 #define LED_OFF     1
 
-DigitalOut g_DO_LedBlue(A5, LED_OFF);
+DigitalOut DataLED(A5, LED_OFF);
+
 Display display;
 
 uint32_t prbs()
@@ -39,37 +40,28 @@
 }
 int main(void) {
   
-    int Count;
+    int count;
+
+   
     display.begin();
-    
-    while(true) {
-        g_Serial_pc.printf("LED Toggle\r\n");     
-        g_DO_LedBlue = !g_DO_LedBlue;
-        
-        for (Count = 0; Count < 200; Count++)
-        {
-            display.drawRectangle(random(0,240),random(0,320),random(0,240),random(0,320),random(0,0xffff));
-        }
-        display.fillRectangle(0,0,240,320,0);
-        for (Count = 0; Count < 200; Count++)
+    while(1)    
+    {
+        DataLED = !DataLED;
+        if (display.penDown()) 
         {
-           
-           display.fillRectangle(random(0,240),random(0,320),random(0,240),random(0,320),random(0,0xffff));           
-
-        }
-        display.fillRectangle(0,0,240,320,0);
-        for (Count = 0; Count < 200; Count++)
+            display.print(display.readXTouch(),10,10,display.RGBToWord(0xff,0xff,0),display.RGBToWord(0,0,0));
+            display.print(display.readYTouch(),80,10,display.RGBToWord(0xff,0xff,0),display.RGBToWord(0,0,0));
+        }        
+        display.drawRectangle(random(0,240),random(0,320),random(0,240),random(0,320),random(0,0xffff));                                
+        //display.fillRectangle(random(0,240),random(0,320),random(0,240),random(0,320),random(0,0xffff));                   
+        display.drawCircle(random(0,240),random(0,240),random(0,320),random(0,0xffff));
+        //display.fillCircle(random(0,240),random(0,320),random(0,120),random(0,0xffff));
+        count++;
+        if (count >= 10) 
         {
-            display.drawCircle(random(0,240),random(0,240),random(0,320),random(0,0xffff));
-
+            display.fillRectangle(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,0);
+            count = 0;
         }
-        display.fillRectangle(0,0,240,320,0);
-        for (Count = 0; Count < 50; Count++)
-        {
-            display.fillCircle(random(0,240),random(0,320),random(0,120),random(0,0xffff));
-
-        }
-        display.fillRectangle(0,0,240,320,0);
         
     }