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: RobotController.h
- Revision:
- 5:77c6821ae418
- Parent:
- 3:1dce1ba5b8bd
- Child:
- 8:bfa4bf23522c
--- a/RobotController.h Fri Apr 12 23:28:04 2019 +0000 +++ b/RobotController.h Sun Apr 14 03:23:36 2019 +0000 @@ -1,16 +1,32 @@ #ifndef ROBOT_CONTROLLER_H #define ROBOT_CONTROLLER_H +#include "mbed.h" #include "Motor.h" #include "HALLFX_ENCODER.h" #include "LSM9DS1.h" /** - * Robot control class. + * Robot Controller class. */ class RobotController { public: /** + * Robot Controller Constructor. + * @param leftWheelPwm mbed pin transmitting speed to left motor driver + * @param leftWheelFwd mbed pin transmitting forward direction to left motor driver + * @param leftWheelRev mbed pin transmitting reverse direction to left motor driver + * @param rightWheelPwm mbed pin transmitting speed to right motor driver + * @param rightWheelFwd mbed pin transmitting forward direction to right motor driver + * @param rightWheelRev mbed pin transmitting reverse direction to right motor driver + * @param leftEncoderIn mbed pin receiving rotation count from left encoder + * @param rightEncoderIn mbed pin receiving rotation count from right encoder + */ + RobotController(PinName leftWheelPwm, PinName leftWheelFwd, + PinName leftWheelRev, PinName rightWheelPwm, PinName rightWheelFwd, + PinName rightWheelRev, PinName leftEncoderIn, PinName rightEncoderIn); + + /** * Detect obstacles in 360-degree field of view around the robot. * @return angle-distance pairs of obstacles */ @@ -28,6 +44,12 @@ */ void toOrigin(float* trajectory); // TODO delete trajectory + + private: + Motor leftWheel; + Motor rightWheel; + HALLFX_ENCODER leftEncoder; + HALLFX_ENCODER rightEncoder; }; #endif /* ROBOT_CONTROLLER_H */ \ No newline at end of file