Simple DC motor control commands for driving DC motor conroller with PWM and up to 2 direction signals (complementary). Takes float value from -1.0 to 1.0.
Dependents: Teensy_Mot_QEI_Ser_20180111 Axis Axis_20181108 Axis_version2
Fork of MotCon by
Overloaded class that takes a pwm motor control pin and one or two direction pins for driving DC motors with a variety of motor control IC's. Tested examples include the LM298, TD340, MC33926, A3949.
Diff: MotCon.h
- Revision:
- 0:3ba12980833b
- Child:
- 1:69e79f1db999
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MotCon.h Mon Aug 31 17:13:55 2015 +0000 @@ -0,0 +1,16 @@ + +#include "mbed.h" + +#ifndef MBED_MOTCON_H +#define MBED_MOTCON_H + +class MotCon{ +public: + MotCon(PinName _pwm, PinName _dir); + void mot_control(float dc); +private: + PwmOut _pwm; + DigitalOut _dir; +}; + +#endif