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.
Diff: motor.h
- Revision:
- 0:4788e1df7b55
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/motor.h Fri Mar 13 11:48:04 2020 +0000
@@ -0,0 +1,45 @@
+#ifndef MOTOR_H
+#define MOTOR_H
+
+#include <mbed.h>
+
+class Motor {
+ public:
+ Motor (AnalogOut& motorAccelerator,
+ AnalogOut& motorBrake,
+ DigitalOut& keySwitch,
+ DigitalOut& directionFwd,
+ DigitalOut& directionRev,
+ DigitalOut& footSwitch,
+ DigitalOut& seatSwitch,
+ DigitalOut& inchFwd,
+ DigitalOut& speedLimit2,
+ DigitalOut& speedLimit3);
+
+ void turnOn();
+ void turnOff();
+ void closeDeadman();
+ void releaseDeadman();
+ void setForward();
+ void setPark();
+ void setReverse();
+ void engage();
+ void disengage();
+ void setSpeedMode(int speed);
+ void throttle(float throttleRate);
+ void brake(float brakeRate);
+
+ private:
+ AnalogOut& _motorAccelerator;
+ AnalogOut& _motorBrake;
+ DigitalOut& _keySwitch;
+ DigitalOut& _directionFwd;
+ DigitalOut& _directionRev;
+ DigitalOut& _footSwitch;
+ DigitalOut& _seatSwitch;
+ DigitalOut& _inchFwd;
+ DigitalOut& _speedLimit2;
+ DigitalOut& _speedLimit3;
+};
+
+#endif
\ No newline at end of file