cleaned up motor class with separate header and .cpp files
Dependencies: mbed
Dependents: TerraBot_Drive_2D TerraBot_Drive_2D TerraBot_Drive_2D_FINAL DUMP_TRUCK_Test ... more
Motor.h@2:7674afbf8e53, 2016-10-24 (annotated)
- Committer:
- simplyellow
- Date:
- Mon Oct 24 20:14:27 2016 +0000
- Revision:
- 2:7674afbf8e53
- Parent:
- 0:0a5af2965205
- Child:
- 4:e87768d3cd09
fixed define line, flasher was there for some reason
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simplyellow | 2:7674afbf8e53 | 1 | #ifndef MOTOR_H |
simplyellow | 2:7674afbf8e53 | 2 | #define MOTOR_H |
simplyellow | 0:0a5af2965205 | 3 | |
simplyellow | 0:0a5af2965205 | 4 | #include "mbed.h" |
simplyellow | 0:0a5af2965205 | 5 | |
simplyellow | 0:0a5af2965205 | 6 | class Motor { |
simplyellow | 0:0a5af2965205 | 7 | public: |
simplyellow | 0:0a5af2965205 | 8 | Motor(PinName pwm, PinName dir); |
simplyellow | 0:0a5af2965205 | 9 | void write(float Val); |
simplyellow | 0:0a5af2965205 | 10 | float read(); |
simplyellow | 0:0a5af2965205 | 11 | private: |
simplyellow | 0:0a5af2965205 | 12 | PwmOut pwmPin; |
simplyellow | 0:0a5af2965205 | 13 | DigitalOut dirPin; |
simplyellow | 0:0a5af2965205 | 14 | float lastVal; |
simplyellow | 0:0a5af2965205 | 15 | |
simplyellow | 0:0a5af2965205 | 16 | }; |
simplyellow | 0:0a5af2965205 | 17 | |
simplyellow | 0:0a5af2965205 | 18 | #endif |