Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos Motor LSM9DS1_Library_cal X_NUCLEO_53L0A1
Diff: main.cpp
- Revision:
- 8:bfa4bf23522c
- Parent:
- 6:c119cc5d48d6
- Child:
- 9:552805fac195
- Child:
- 11:531208aca075
--- a/main.cpp Mon Apr 15 19:26:56 2019 +0000 +++ b/main.cpp Mon Apr 22 23:55:45 2019 +0000 @@ -1,21 +1,24 @@ -#include "mbed.h" #include "globals.h" #include "DataDistributor.h" #include "RobotController.h" Serial pc(USBTX, USBRX); -DigitalIn pb(p26); +BusOut led(LED1, LED2, LED3, LED4); +DigitalIn pb(p23); + +float* obstacles = new float[360]; +int trajectoryLength = 0; +float* trajectory = new float[0]; int main() { - pb.mode(PullUp); + delete []trajectory; DataDistributor dataDistributor; - RobotController robotController(p21, p15, p16, p22, p18, p19, p17, p20); + RobotController robotController(p21, p15, p16, p22, p18, p19, p13, p14); while(1) { - float* obstacles = robotController.obstacleDetection(); - dataDistributor.sendObstacles(obstacles); - float* trajectory = dataDistributor.receiveTrajectory(); - robotController.followTrajectory(trajectory); - robotController.toOrigin(trajectory); + robotController.detectObstacles(); + dataDistributor.transmitObstacles(); + dataDistributor.receiveTrajectory(); + robotController.followTrajectory(); } } \ No newline at end of file