This library is an attempt to encapsulate the Pololu motor board MC33926 Motor Driver Carrier.

/media/uploads/buckeyes1997/0j1889.200.jpg

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.

Committer:
buckeyes1997
Date:
Mon Feb 11 20:53:20 2013 +0000
Revision:
1:69e4a93b718d
Parent:
0:b7c4b6de973e
added more checks on speed

Who changed what in which revision?

UserRevisionLine numberNew 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