Projet Interfaçage

Dependencies:   BSP_DISCO_F746NG

Files at this revision

API Documentation at this revision

Comitter:
liroy_theilor
Date:
Wed Jun 23 14:06:26 2021 +0000
Parent:
5:8ffa1e1d4895
Commit message:
Projet

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Jun 22 18:46:49 2021 +0000
+++ b/main.cpp	Wed Jun 23 14:06:26 2021 +0000
@@ -65,6 +65,8 @@
     BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
     BSP_LCD_Clear(LCD_COLOR_DARKCYAN );
     
+    //************INTERFACE************
+    
     sprintf((char*)text, "BOITES AUX LETTRES ");
      BSP_LCD_DisplayStringAt(20, LINE(1), (uint8_t *)&text, CENTER_MODE);
                 
@@ -140,6 +142,9 @@
     BSP_LCD_DrawCircle(260, 224,20);   
     BSP_LCD_DrawCircle(305, 224,20);
     BSP_LCD_DrawRect(220, 249, 60,30);
+    
+    
+     //************INTERFACE************
            
  servo.pulsewidth_us (2000);
 
@@ -164,16 +169,11 @@
 
             cleared = 0;
 
-          //  sprintf((char*)text, "Touches: %d", TS_State.touchDetected);
-        //    BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE);
-
             for (idx = 0; idx < TS_State.touchDetected; idx++) {
                 x = TS_State.touchX[idx];
                 y = TS_State.touchY[idx];
-              //  sprintf((char*)text, "Touch %d: x=%d y=%d    ", idx+1, x, y);
-              //  BSP_LCD_DisplayStringAt(0, LINE(idx+1), (uint8_t *)&text, LEFT_MODE);
-                
-                
+             
+                              
                 
           
             }
@@ -181,9 +181,7 @@
           
         } else {
             if (!cleared) {
-               // BSP_LCD_Clear(LCD_COLOR_BLUE);
-               // sprintf((char*)text, "Touches: 0");
-                //BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE);
+             
                 cleared = 1;
                 
                 
@@ -216,8 +214,7 @@
              {
                         sprintf((char*)text, "Touches: 3");
                 BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE);
-                
-                                PSWD[i]='3';
+                                 PSWD[i]='3';
                                  i++;
              }
                        
@@ -302,8 +299,7 @@
                 HAL_Delay(1000);
                 
                     servo.pulsewidth_us (1000);
-                   // ThisThread::sleep_for(1s);
-                     HAL_Delay(1000);
+                      HAL_Delay(1000);
                     i=0;
                     
                 }
@@ -322,14 +318,10 @@
                 HAL_Delay(1000);
                 
                     servo.pulsewidth_us (1000);
-                   // ThisThread::sleep_for(1s);
-                     HAL_Delay(1000);
+                    HAL_Delay(1000);
                     i=0;
-                }
-                
-      
-                
-                
+                }               
+                               
                 
                 
                  else if (i>=3)
@@ -342,7 +334,6 @@
                  }
                         sprintf((char*)text, "Nombre de colis:  %d", colis);
               BSP_LCD_DisplayStringAt(0, LINE(10 ), (uint8_t *)&text, LEFT_MODE);
-
                  
                  compteur=0;
                  
@@ -353,8 +344,7 @@
                 BSP_LCD_DisplayStringAt(15, LINE(6), (uint8_t *)&text, CENTER_MODE);
                 HAL_Delay(1000);
                 
-                    servo.pulsewidth_us (2000);
-                    //ThisThread::sleep_for(1s);
+                    servo.pulsewidth_us (2000);                   
                     HAL_Delay(1000);
                     i=0;
                 }
@@ -377,7 +367,7 @@
              
         switch(lecture)
             {
-                case 0:     // detection lettres
+                case 0:     // detection   des lettres
                 obstak=true;
                     break;