Yeongsoo Kim / Mbed 2 deprecated Mecha_DC_control

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Motor.h Source File

Motor.h

00001 #ifndef MBED_MOTOR_H
00002 #define MBED_MOTOR_H
00003 
00004 #include "mbed.h"
00005 
00006 
00007 #define FORWARD 1.0
00008 #define BACKWARD -1.0
00009 
00010 
00011 class Motor
00012 {
00013 private:
00014     PwmOut IN1_, IN2_;
00015     DigitalOut INH1_, INH2_;
00016 
00017 public:
00018     Motor(PinName IN1, PinName IN2,PinName INH1, PinName INH2);
00019 
00020     void setSpeed_percent(float percent, float direction);
00021 };
00022 
00023 #endif