STM32F7-Discovery - TFT + Touch and Count down Timer Ver.1.0.5

Dependencies:   BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG mbed

Fork of F746NG_TIMER by Enrico Marinoni

Files at this revision

API Documentation at this revision

Comitter:
emcu
Date:
Fri Mar 04 10:20:28 2016 +0000
Parent:
3:a99d1624ff73
Commit message:
STM32F7-Discovery - TFT + Touch and Count down Timer; Ver.1.0.5

Changed in this revision

BSP_DISCO_F746NG.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
diff -r a99d1624ff73 -r 0d9d4ea58fdb BSP_DISCO_F746NG.lib
--- a/BSP_DISCO_F746NG.lib	Sun Feb 28 17:43:40 2016 +0000
+++ b/BSP_DISCO_F746NG.lib	Fri Mar 04 10:20:28 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/emcu/code/BSP_DISCO_F746NG/#6d1c610a574a
+https://developer.mbed.org/teams/ST/code/BSP_DISCO_F746NG/#ee089790cdbb
diff -r a99d1624ff73 -r 0d9d4ea58fdb main.cpp
--- a/main.cpp	Sun Feb 28 17:43:40 2016 +0000
+++ b/main.cpp	Fri Mar 04 10:20:28 2016 +0000
@@ -5,7 +5,7 @@
     STM32F7-Discovery Demo by www.emcu.it
     
     Date: Feb.2016
-    Ver.: 1.0.4
+    Ver.: 1.0.5
 
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
@@ -154,7 +154,7 @@
         lcd.DisplayStringAt(xpos, LINE(7), (uint8_t *)&text, LEFT_MODE);
         
         // Draw the RED box that indicate the area to touch for start Timer
-        FillBox(0xFFFF0000, 250, 220, 50, 50);        
+        FillBox(0xFFFF0000, (lcd.GetXSize()/2)-25, 200, 50, 50);        
         
         // Whait touch        
         ts.GetState(&TS_State);
@@ -199,7 +199,7 @@
         wait(0.1);
         
         // Draw the RED box that indicate the area to touch for start Timer
-        FillBox(0xFFFF0000,250, 220, 50, 50);
+        FillBox(0xFFFF0000, (lcd.GetXSize()/2)-25, 200, 50, 50);
         
         Count=0;
         
@@ -208,7 +208,7 @@
             {        
             x = TS_State.touchX[idx];
             y = TS_State.touchY[idx];
-            if ((x>260 & x<300) && (y>250 & y<280))
+            if ((x>((lcd.GetXSize()/2)-25)) & (x<((lcd.GetXSize()/2)+25)) && (y>175 & y<225))
                 {
                 lcd.Clear(LCD_COLOR_BLACK);
                 lcd.SetFont(&Font24);
@@ -255,7 +255,7 @@
                         sprintf((char*)text, " Minutes that remain:  %d ", _min);
                         lcd.DisplayStringAt(xpos, LINE(5), (uint8_t *)&text, LEFT_MODE);
                         if (Count == 0)
-                            // Clear 1° cifra
+                            // Clear 1° cifra
                             FillBox(LCD_COLOR_BLACK, 300, 200, 40, 70);
                         else
                             DisplayBigNumber(_min);
@@ -359,23 +359,23 @@
     }
     else // Number < 100
     {
-        // Clear 3° cifra
+        // Clear 3° cifra
         FillBox(LCD_COLOR_BLACK, 200, 200, 40, 70);
         
         if (Numero >= 10)
         {
             v = Numero / 10;
             mv = v;
-            VisNumber(250, 200, LCD_YELLOW, v, LCD_COLOR_BLACK);    // Vis. 2° cifra
+            VisNumber(250, 200, LCD_YELLOW, v, LCD_COLOR_BLACK);    // Vis. 2° cifra
             
             v = Numero - (mv * 10);
-            VisNumber(300, 200, LCD_YELLOW, v, LCD_COLOR_BLACK);    // Vis. 3° cifra
+            VisNumber(300, 200, LCD_YELLOW, v, LCD_COLOR_BLACK);    // Vis. 3° cifra
         } 
         else 
         {
-            // Clear 2° cifra
+            // Clear 2° cifra
             FillBox(LCD_COLOR_BLACK, 250, 200, 40, 70);
-            VisNumber(300, 200, LCD_YELLOW, Numero, LCD_COLOR_BLACK);    // Vis. 3° cifra
+            VisNumber(300, 200, LCD_YELLOW, Numero, LCD_COLOR_BLACK);    // Vis. 3° cifra
         }
     }