Lidar
Dependencies: TS_DISCO_F746NG mbed BufferedSerial LCD_DISCO_F746NG mbed-rtos Trigo BSP_DISCO_F746NG
Revision 1:1ff3fe3679c1, committed 2016-11-23
- Comitter:
- Carminio
- Date:
- Wed Nov 23 16:18:07 2016 +0000
- Parent:
- 0:88706d6abbf7
- Child:
- 2:8f71c97fe9d7
- Commit message:
- Versione con pulsanti da sistemare
Changed in this revision
--- a/Communication.cpp Wed Nov 23 15:19:33 2016 +0000 +++ b/Communication.cpp Wed Nov 23 16:18:07 2016 +0000 @@ -114,11 +114,9 @@ } wait_ms(2000); - lcdComm.Clear(LCD_COLOR_BLACK); + //lcdComm.Clear(LCD_COLOR_BLACK); lcdComm.SetBackColor(LCD_COLOR_GREEN); - // lcdComm.Clear(LCD_COLOR_BLUE); -// lcdComm.SetBackColor(LCD_COLOR_BLUE); - lcdComm.SetTextColor(LCD_COLOR_WHITE); +// lcdComm.SetTextColor(LCD_COLOR_WHITE); wait(0.3); countClear=0; @@ -158,7 +156,7 @@ // lcdComm.DrawPixel(distanceXLCD,distanceYLCD,LCD_COLOR_GREEN); wait_ms(1); -// + if (countClear > 360) { @@ -166,10 +164,6 @@ countClear=0; } - - - - } }
--- a/Main.cpp Wed Nov 23 15:19:33 2016 +0000 +++ b/Main.cpp Wed Nov 23 16:18:07 2016 +0000 @@ -6,14 +6,18 @@ #include <stdlib.h> #include <stdio.h> #include "LCD_DISCO_F746NG.h" - -LCD_DISCO_F746NG lcd; - +#include "TS_DISCO_F746NG.h" //Dichiarazione oggetti DigitalIn myStartButton(USER_BUTTON); Motor lid_Motor(PWM_OUT); Communication SendCommands; +LCD_DISCO_F746NG lcd; +TS_DISCO_F746NG ts; + +//Dichiarazione variabili +uint16_t x, y; +uint8_t idx; int main() { // Initialize Display @@ -23,8 +27,35 @@ 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); + +// 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.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) { + +// Initialize TFT display + ts.GetState(&TS_State); + if (TS_State.touchDetected) { + for (idx = 0; idx < TS_State.touchDetected; idx++) { + x = TS_State.touchX[idx]; + y = TS_State.touchY[idx]; + } +// if((x>=10) && (x<=60) && (y>=13) && (y<=63)) { // Initialize UART SendCommands.confUART(); @@ -47,6 +78,8 @@ // SendCommands.Stop(); // wait_ms(100); // lid_Motor.StopMotor_Scan(); +// } + } } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TS_DISCO_F746NG.lib Wed Nov 23 16:18:07 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/ST/code/TS_DISCO_F746NG/#fe0cf5e2960f