Railway Challenge
/
challenge
Uncommenting of part that allow supercaps to charge up from the batteries
motor.h@0:4788e1df7b55, 2020-03-13 (annotated)
- Committer:
- rwcjoliver
- Date:
- Fri Mar 13 11:48:04 2020 +0000
- Revision:
- 0:4788e1df7b55
Uncommented RegenBRaking lines to allow capacitors to charge up from the batteries
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rwcjoliver | 0:4788e1df7b55 | 1 | #ifndef MOTOR_H |
rwcjoliver | 0:4788e1df7b55 | 2 | #define MOTOR_H |
rwcjoliver | 0:4788e1df7b55 | 3 | |
rwcjoliver | 0:4788e1df7b55 | 4 | #include <mbed.h> |
rwcjoliver | 0:4788e1df7b55 | 5 | |
rwcjoliver | 0:4788e1df7b55 | 6 | class Motor { |
rwcjoliver | 0:4788e1df7b55 | 7 | public: |
rwcjoliver | 0:4788e1df7b55 | 8 | Motor (AnalogOut& motorAccelerator, |
rwcjoliver | 0:4788e1df7b55 | 9 | AnalogOut& motorBrake, |
rwcjoliver | 0:4788e1df7b55 | 10 | DigitalOut& keySwitch, |
rwcjoliver | 0:4788e1df7b55 | 11 | DigitalOut& directionFwd, |
rwcjoliver | 0:4788e1df7b55 | 12 | DigitalOut& directionRev, |
rwcjoliver | 0:4788e1df7b55 | 13 | DigitalOut& footSwitch, |
rwcjoliver | 0:4788e1df7b55 | 14 | DigitalOut& seatSwitch, |
rwcjoliver | 0:4788e1df7b55 | 15 | DigitalOut& inchFwd, |
rwcjoliver | 0:4788e1df7b55 | 16 | DigitalOut& speedLimit2, |
rwcjoliver | 0:4788e1df7b55 | 17 | DigitalOut& speedLimit3); |
rwcjoliver | 0:4788e1df7b55 | 18 | |
rwcjoliver | 0:4788e1df7b55 | 19 | void turnOn(); |
rwcjoliver | 0:4788e1df7b55 | 20 | void turnOff(); |
rwcjoliver | 0:4788e1df7b55 | 21 | void closeDeadman(); |
rwcjoliver | 0:4788e1df7b55 | 22 | void releaseDeadman(); |
rwcjoliver | 0:4788e1df7b55 | 23 | void setForward(); |
rwcjoliver | 0:4788e1df7b55 | 24 | void setPark(); |
rwcjoliver | 0:4788e1df7b55 | 25 | void setReverse(); |
rwcjoliver | 0:4788e1df7b55 | 26 | void engage(); |
rwcjoliver | 0:4788e1df7b55 | 27 | void disengage(); |
rwcjoliver | 0:4788e1df7b55 | 28 | void setSpeedMode(int speed); |
rwcjoliver | 0:4788e1df7b55 | 29 | void throttle(float throttleRate); |
rwcjoliver | 0:4788e1df7b55 | 30 | void brake(float brakeRate); |
rwcjoliver | 0:4788e1df7b55 | 31 | |
rwcjoliver | 0:4788e1df7b55 | 32 | private: |
rwcjoliver | 0:4788e1df7b55 | 33 | AnalogOut& _motorAccelerator; |
rwcjoliver | 0:4788e1df7b55 | 34 | AnalogOut& _motorBrake; |
rwcjoliver | 0:4788e1df7b55 | 35 | DigitalOut& _keySwitch; |
rwcjoliver | 0:4788e1df7b55 | 36 | DigitalOut& _directionFwd; |
rwcjoliver | 0:4788e1df7b55 | 37 | DigitalOut& _directionRev; |
rwcjoliver | 0:4788e1df7b55 | 38 | DigitalOut& _footSwitch; |
rwcjoliver | 0:4788e1df7b55 | 39 | DigitalOut& _seatSwitch; |
rwcjoliver | 0:4788e1df7b55 | 40 | DigitalOut& _inchFwd; |
rwcjoliver | 0:4788e1df7b55 | 41 | DigitalOut& _speedLimit2; |
rwcjoliver | 0:4788e1df7b55 | 42 | DigitalOut& _speedLimit3; |
rwcjoliver | 0:4788e1df7b55 | 43 | }; |
rwcjoliver | 0:4788e1df7b55 | 44 | |
rwcjoliver | 0:4788e1df7b55 | 45 | #endif |