RPLIDAR A1M8 LCD

Dependencies:   TS_DISCO_F746NG mbed BufferedSerial LCD_DISCO_F746NG mbed-rtos Trigo BSP_DISCO_F746NG

Revision:
2:8f71c97fe9d7
Parent:
1:1ff3fe3679c1
Child:
3:43ab856b5efa
--- a/Main.cpp	Wed Nov 23 16:18:07 2016 +0000
+++ b/Main.cpp	Wed Nov 23 17:01:03 2016 +0000
@@ -18,6 +18,7 @@
 //Dichiarazione variabili
 uint16_t x, y;
 uint8_t idx;
+uint8_t start=1;
 
 int main() {
 //  Initialize Display
@@ -27,26 +28,21 @@
     wait(0.3);
     lcd.SetFont(&Font24);
     lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"SLAMTEC LIDAR A2", CENTER_MODE);
-//    wait(2);
-    lcd.Clear(LCD_COLOR_BLACK);
-    
+    lcd.SetFont(&Font8);
+    lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"STMicroelectronics", RIGHT_MODE);
+    lcd.DisplayStringAt(0, LINE(2), (uint8_t *)"D. Ruggiero 2016", RIGHT_MODE);
+
 //  Configure buttons and TFT display
     TS_StateTypeDef TS_State;
     lcd.SetTextColor(LCD_COLOR_GREEN);
-    lcd.FillRect(10, 13, 50, 50);  ///Disegna bottone Verde
-    //lcd.SetTextColor(LCD_COLOR_RED);
-//    lcd.FillRect(10, 80, 50, 50);  ///Disegna bottone Rosso
-    lcd.SetFont(&Font16);
-    wait(0.3);
+    lcd.FillRect(136, 200, 200, 50);  ///Disegna bottone Verde
+
+    lcd.SetFont(&Font24);
     lcd.SetBackColor(LCD_COLOR_GREEN);
     lcd.SetTextColor(LCD_COLOR_BLACK);
-    lcd.DisplayStringAt(13, LINE(2), (uint8_t *)"SCAN", LEFT_MODE);
-    //lcd.SetBackColor(LCD_COLOR_RED);
-//    lcd.SetTextColor(LCD_COLOR_BLACK);
-//    lcd.DisplayStringAt(13, LINE(6), (uint8_t *)"STOP", LEFT_MODE);    
-    
- if (myStartButton == 1) {
-//  while(1) {
+    lcd.DisplayStringAt(202, LINE(9), (uint8_t *)"SCAN", LEFT_MODE);
+
+  while(start) {
       
 //    Initialize TFT display
       ts.GetState(&TS_State);
@@ -55,7 +51,9 @@
                 x = TS_State.touchX[idx];
                 y = TS_State.touchY[idx];
           }
-//     if((x>=10) && (x<=60) && (y>=13) && (y<=63)) {
+
+     if((x>=136) && (x<=336) && (y>=200) && (y<=250)) {    
+     lcd.Clear(LCD_COLOR_BLACK);
 
 //   Initialize UART
      SendCommands.confUART();
@@ -78,7 +76,8 @@
 //   SendCommands.Stop();
 //   wait_ms(100);
 //   lid_Motor.StopMotor_Scan();
-//        }
+     start=0;
+        }
     }
  }
 }