Dependencies: Motordriver mbed-rtos mbed
Fork of MultiModalRobotSM by
MultiModalRobot/MultiModalRobot.cpp@15:9bc36f47c8cf, 2017-11-20 (annotated)
- Committer:
- baijun
- Date:
- Mon Nov 20 03:18:42 2017 +0000
- Revision:
- 15:9bc36f47c8cf
- Child:
- 20:e1a78ee68726
Same thing but with our new MultiModalRobot class.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
baijun | 15:9bc36f47c8cf | 1 | #include "MultiModalRobot.h" |
baijun | 15:9bc36f47c8cf | 2 | |
baijun | 15:9bc36f47c8cf | 3 | MultiModalRobot::MultiModalRobot(Motor& left, Motor& right) : leftWheel(left), rightWheel(right) {} |
baijun | 15:9bc36f47c8cf | 4 | |
baijun | 15:9bc36f47c8cf | 5 | |
baijun | 15:9bc36f47c8cf | 6 | |
baijun | 15:9bc36f47c8cf | 7 | void MultiModalRobot::driveWheels(float leftSpeed, float rightSpeed){ |
baijun | 15:9bc36f47c8cf | 8 | leftWheel.speed(leftSpeed); |
baijun | 15:9bc36f47c8cf | 9 | rightWheel.speed(rightSpeed); |
baijun | 15:9bc36f47c8cf | 10 | } |
baijun | 15:9bc36f47c8cf | 11 | |
baijun | 15:9bc36f47c8cf | 12 | void MultiModalRobot::stop(float dutyCycle){ |
baijun | 15:9bc36f47c8cf | 13 | leftWheel.stop(dutyCycle); |
baijun | 15:9bc36f47c8cf | 14 | rightWheel.stop(dutyCycle); |
baijun | 15:9bc36f47c8cf | 15 | } |