Lidar
Dependencies: TS_DISCO_F746NG mbed BufferedSerial LCD_DISCO_F746NG mbed-rtos Trigo BSP_DISCO_F746NG
Revision 3:43ab856b5efa, committed 2016-11-24
- Comitter:
- Carminio
- Date:
- Thu Nov 24 09:50:36 2016 +0000
- Parent:
- 2:8f71c97fe9d7
- Child:
- 4:0df95765b1b0
- Commit message:
- Ver. ok debug pulsante stop
Changed in this revision
Main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Main.cpp Wed Nov 23 17:01:03 2016 +0000 +++ b/Main.cpp Thu Nov 24 09:50:36 2016 +0000 @@ -8,8 +8,10 @@ #include "LCD_DISCO_F746NG.h" #include "TS_DISCO_F746NG.h" + //Dichiarazione oggetti -DigitalIn myStartButton(USER_BUTTON); +//DigitalIn myStartButton(USER_BUTTON); +InterruptIn myStopButton(USER_BUTTON); Motor lid_Motor(PWM_OUT); Communication SendCommands; LCD_DISCO_F746NG lcd; @@ -20,6 +22,14 @@ uint8_t idx; uint8_t start=1; +void pressed() +{ + SendCommands.Stop(); + wait_ms(100); + lid_Motor.StopMotor_Scan(); +} + + int main() { // Initialize Display lcd.Clear(LCD_COLOR_BLACK); @@ -69,16 +79,35 @@ // Start motor (PWM: Frequency 25KHz, Duty cycle 60%) lid_Motor.StartMotor_Scan(); - + // Start scan SendCommands.Scan(); - -// SendCommands.Stop(); -// wait_ms(100); -// lid_Motor.StopMotor_Scan(); start=0; } } } + + //while(1) { +// if (myStartButton == 1) { +// SendCommands.Stop(); +// wait_ms(100); +// lid_Motor.StopMotor_Scan(); +// } +// } + + //while(1) { +// myStopButton.rise(&pressed); +// } + + //while(1) { +// // Initialize TFT display +// ts.GetState(&TS_State); +// if (TS_State.touchDetected) { +// SendCommands.Stop(); +// wait_ms(100); +// lid_Motor.StopMotor_Scan(); +// } +// } } - + +