Sets motor currents based on input motorvalue
motorConfig.h@2:91ea2963629a, 2017-10-23 (annotated)
- Committer:
- tvlogman
- Date:
- Mon Oct 23 13:47:38 2017 +0000
- Revision:
- 2:91ea2963629a
- Parent:
- 1:84cb991c4d28
Works now
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tvlogman | 0:131a76b8848a | 1 | #ifndef MOTORCONFIG_H |
tvlogman | 0:131a76b8848a | 2 | #define MOTORCONFIG_H |
tvlogman | 0:131a76b8848a | 3 | |
tvlogman | 0:131a76b8848a | 4 | #include "mbed.h" |
tvlogman | 0:131a76b8848a | 5 | #include "FastPWM.h" |
tvlogman | 0:131a76b8848a | 6 | |
tvlogman | 0:131a76b8848a | 7 | class motorConfig { |
tvlogman | 0:131a76b8848a | 8 | public: |
tvlogman | 2:91ea2963629a | 9 | motorConfig(PinName, PinName); |
tvlogman | 0:131a76b8848a | 10 | void setMotor(float motorValue); |
tvlogman | 0:131a76b8848a | 11 | void turnMotorOn(); |
tvlogman | 2:91ea2963629a | 12 | void kill(); |
tvlogman | 0:131a76b8848a | 13 | |
tvlogman | 2:91ea2963629a | 14 | private: |
tvlogman | 0:131a76b8848a | 15 | DigitalOut directionPin; //D4 |
tvlogman | 0:131a76b8848a | 16 | PwmOut pwmPin; //D5 |
tvlogman | 0:131a76b8848a | 17 | }; |
tvlogman | 0:131a76b8848a | 18 | #endif |