A simple class which can be used to control a motor through a HBridge (such as the L293).

Dependents:   SimplePIDBot

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers HBridgeMotor.h Source File

HBridgeMotor.h

00001 #include "mbed.h"
00002 
00003 class HBridgeMotor {
00004 public:
00005     HBridgeMotor(PinName fin, PinName rin);
00006     void set(float power);
00007     float read();
00008     
00009 private:
00010     float power;
00011     PwmOut fwd, rev;
00012 };