You are viewing an older revision! See the latest version
Motor
An interface for driving a standard DC motor with PWM and an H-Bridge
Hello World!¶
main.cpp
// Sweep speed from full-speed reverse (-1.0) to forwards (1.0)
#include "mbed.h"
#include "Motor.h"
Motor m(p23, p6, p5); // pwm, fwd, rev
int main() {
for (float s=-1.0; s < 1.0 ; s += 0.01) {
m.speed(s);
wait(0.02);
}
}
Library¶
Example¶
This example show you how to wire up the L293D dual H bridge driver. Data sheet can be found at:
