Motor
Dependents: Nucleo_spi 2015_denziben_i2c_S2 Nucleo_Motor Nucleo_Motor ... more
Diff: Motor.h
- Revision:
- 5:3b639d84a95d
- Parent:
- 4:56a1159c881c
--- a/Motor.h Fri Oct 30 12:47:35 2015 +0000 +++ b/Motor.h Sun Aug 07 12:45:33 2016 +0000 @@ -8,7 +8,7 @@ #define Stop 3 #define Free 4 class Motor { -protected : PinName Pin[5]; +protected : PinName Pin[3]; float bias; Motor(const Motor& m); Motor& operator=(const Motor &m) { @@ -16,17 +16,17 @@ } public: - Motor(PinName _pin_h1, PinName _pin_g2, PinName _pin_g1, PinName _pin_h2,PinName _pwm); + Motor(PinName _pin1, PinName _pin2,PinName _pwm); Motor& operator= (float duty) { - if(duty<-0.1F) + if(duty<-0.01F) { duty*=-1; run(Back,duty); } - else if(float(duty)>0.1F) + else if(float(duty)>0.01F) { run(Front,duty); } @@ -46,7 +46,7 @@ private: int state; float Duty; - BusOut motor; + BusOut mode; PwmOut PwmPin; };