![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
the fish that looks like a jet
Dependencies: ADXL345 ADXL345_I2C IMUfilter ITG3200 mbed Servo
Diff: motor_controller.h
- Revision:
- 0:ff9bc5f69c57
- Child:
- 6:a4d6f3e4bf28
diff -r 000000000000 -r ff9bc5f69c57 motor_controller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/motor_controller.h Tue Jan 21 21:32:05 2014 +0000 @@ -0,0 +1,19 @@ +#pragma once +#include "mbed.h" + +class PololuMController +{ + private: + PwmOut* pwm; + DigitalOut* outA; + DigitalOut* outB; + float timestamp; + public: + PololuMController(); + PololuMController(PinName pwmport, PinName A, PinName B); + ~PololuMController(); + void setspeed(float speed); //0 to 1 + void setpolarspeed(float speed); //-1 to 1 + void reverse(); //only works on non-polar speed + void drive_sinusoidal(float cur_time, float a, float w, float phi); //a*sin(w*cur_time+phi) +}; \ No newline at end of file