This library is an attempt to encapsulate the Pololu motor board MC33926 Motor Driver Carrier.
http://www.pololu.com/catalog/product/1213
Dual MC33926 Motor Driver Carrier
This dual brushed DC motor driver, based on Freescale’s MC33926 full H-bridge, has a wide operating range of 5 – 28 V and can deliver almost 3 A continuously (5 A peak) to each of its two motor channels. The MC33926 works with 3 – 5 V logic levels, supports ultrasonic (up to 20 kHz) PWM, and features current feedback, under-voltage protection, over-current protection, and over-temperature protection.
Motor.h@0:b7c4b6de973e, 2013-02-11 (annotated)
- Committer:
- buckeyes1997
- Date:
- Mon Feb 11 19:49:50 2013 +0000
- Revision:
- 0:b7c4b6de973e
Dual MC33926 Motor Driver Carrier from Pololu.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
buckeyes1997 | 0:b7c4b6de973e | 1 | #ifndef MBED_MOTOR_H |
buckeyes1997 | 0:b7c4b6de973e | 2 | #define MBED_MOTOR_H |
buckeyes1997 | 0:b7c4b6de973e | 3 | |
buckeyes1997 | 0:b7c4b6de973e | 4 | #include "mbed.h" |
buckeyes1997 | 0:b7c4b6de973e | 5 | |
buckeyes1997 | 0:b7c4b6de973e | 6 | class Motor |
buckeyes1997 | 0:b7c4b6de973e | 7 | { |
buckeyes1997 | 0:b7c4b6de973e | 8 | public: |
buckeyes1997 | 0:b7c4b6de973e | 9 | |
buckeyes1997 | 0:b7c4b6de973e | 10 | |
buckeyes1997 | 0:b7c4b6de973e | 11 | Motor(PinName pwm, PinName dir1, PinName dir2); |
buckeyes1997 | 0:b7c4b6de973e | 12 | |
buckeyes1997 | 0:b7c4b6de973e | 13 | float speed(float speed, bool direction); |
buckeyes1997 | 0:b7c4b6de973e | 14 | float speed(float speed); |
buckeyes1997 | 0:b7c4b6de973e | 15 | Motor& operator= (float speed); |
buckeyes1997 | 0:b7c4b6de973e | 16 | |
buckeyes1997 | 0:b7c4b6de973e | 17 | |
buckeyes1997 | 0:b7c4b6de973e | 18 | protected: |
buckeyes1997 | 0:b7c4b6de973e | 19 | PwmOut _pwm; |
buckeyes1997 | 0:b7c4b6de973e | 20 | DigitalOut _dir1; |
buckeyes1997 | 0:b7c4b6de973e | 21 | DigitalOut _dir2; |
buckeyes1997 | 0:b7c4b6de973e | 22 | bool _direction; |
buckeyes1997 | 0:b7c4b6de973e | 23 | |
buckeyes1997 | 0:b7c4b6de973e | 24 | |
buckeyes1997 | 0:b7c4b6de973e | 25 | }; |
buckeyes1997 | 0:b7c4b6de973e | 26 | |
buckeyes1997 | 0:b7c4b6de973e | 27 | #endif |