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
main.cpp@3:1dce1ba5b8bd, 2019-04-12 (annotated)
- Committer:
- rpatelpj
- Date:
- Fri Apr 12 23:23:18 2019 +0000
- Revision:
- 3:1dce1ba5b8bd
- Parent:
- 1:9feec6f69f72
- Child:
- 5:77c6821ae418
Setup modular functionality in main, Outline RobotController class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rpatelpj | 0:66b7ea9af0dc | 1 | #include "mbed.h" |
rpatelpj | 3:1dce1ba5b8bd | 2 | #include "DataDistributor.h" |
rpatelpj | 3:1dce1ba5b8bd | 3 | #include "RobotController.h" |
rpatelpj | 0:66b7ea9af0dc | 4 | #include "Motor.h" |
rpatelpj | 0:66b7ea9af0dc | 5 | #include "HALLFX_ENCODER.h" |
rpatelpj | 0:66b7ea9af0dc | 6 | #include "LSM9DS1.h" |
rpatelpj | 0:66b7ea9af0dc | 7 | |
rpatelpj | 3:1dce1ba5b8bd | 8 | extern Serial pc(USBTX, USBRX); |
rpatelpj | 0:66b7ea9af0dc | 9 | |
rpatelpj | 0:66b7ea9af0dc | 10 | int main() { |
rpatelpj | 3:1dce1ba5b8bd | 11 | DataDistributor dataDistributor(); |
rpatelpj | 3:1dce1ba5b8bd | 12 | RobotController robotController(); |
rpatelpj | 3:1dce1ba5b8bd | 13 | |
rpatelpj | 3:1dce1ba5b8bd | 14 | while(1) { |
rpatelpj | 3:1dce1ba5b8bd | 15 | float* obstacles = robotController.obstacleDetection(); |
rpatelpj | 3:1dce1ba5b8bd | 16 | dataDistributor.sendObstacles(obstacles); |
rpatelpj | 3:1dce1ba5b8bd | 17 | float* trajectory = dataDistributor.receiveTrajectory(); |
rpatelpj | 3:1dce1ba5b8bd | 18 | robotController.followTrajectory(trajectory); |
rpatelpj | 3:1dce1ba5b8bd | 19 | robotController.toOrigin(trajectory); |
rpatelpj | 3:1dce1ba5b8bd | 20 | } |
rpatelpj | 0:66b7ea9af0dc | 21 | } |