Yeongsoo Kim / Mbed 2 deprecated Mecha_Speed_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 #define FORWARD 'f'
00007 #define BACKWARD 'b'
00008 #define BREAK 's'
00009 
00010 class Motor
00011 {
00012 private:
00013     PwmOut IN1_, IN2_;
00014     DigitalOut INH1_, INH2_;
00015 
00016 public:
00017     Motor(PinName IN1, PinName IN2,PinName INH1, PinName INH2);
00018 
00019     void setSpeed_percent(float percent, char direction);
00020 };
00021 
00022 #endif