RPLIDAR A1M8 LCD
Dependencies: TS_DISCO_F746NG mbed BufferedSerial LCD_DISCO_F746NG mbed-rtos Trigo BSP_DISCO_F746NG
Diff: Main.cpp
- Revision:
- 0:88706d6abbf7
- Child:
- 1:1ff3fe3679c1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Main.cpp Wed Nov 23 15:19:33 2016 +0000 @@ -0,0 +1,52 @@ +#include "mbed.h" +#include "Serial.h" +#include "BufferedSerial.h" +#include "Communication.h" +#include "Motor.h" +#include <stdlib.h> +#include <stdio.h> +#include "LCD_DISCO_F746NG.h" + +LCD_DISCO_F746NG lcd; + + +//Dichiarazione oggetti +DigitalIn myStartButton(USER_BUTTON); +Motor lid_Motor(PWM_OUT); +Communication SendCommands; + +int main() { +// Initialize Display + lcd.Clear(LCD_COLOR_BLACK); + lcd.SetBackColor(LCD_COLOR_BLACK); + lcd.SetTextColor(LCD_COLOR_GREEN); + wait(0.3); + lcd.SetFont(&Font24); + lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"SLAMTEC LIDAR A2", CENTER_MODE); + + if (myStartButton == 1) { + +// Initialize UART + SendCommands.confUART(); + + // Perform a device reset +// SendCommands.Reset(); + + // Send Get_Health command +// SendCommands.Get_Health(); + + // Send Get_Info command +// SendCommands.Get_Info(); + + // 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(); + } +} +