![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
the fish that looks like a jet
Dependencies: ADXL345 ADXL345_I2C IMUfilter ITG3200 mbed Servo
motor_controller.h@7:e005cfaff8d1, 2014-01-30 (annotated)
- Committer:
- sandwich
- Date:
- Thu Jan 30 02:04:23 2014 +0000
- Revision:
- 7:e005cfaff8d1
- Parent:
- 6:a4d6f3e4bf28
- Child:
- 8:0574a5db1fc4
removed rtos and added interrupt reading
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sandwich | 0:ff9bc5f69c57 | 1 | #pragma once |
sandwich | 0:ff9bc5f69c57 | 2 | #include "mbed.h" |
rkk | 6:a4d6f3e4bf28 | 3 | #define MATH_PI 3.14159265359 |
rkk | 6:a4d6f3e4bf28 | 4 | #define FREQ_MIN 0.5 //Hz |
sandwich | 7:e005cfaff8d1 | 5 | #define FREQ_MAX 3 //Hz |
sandwich | 7:e005cfaff8d1 | 6 | |
sandwich | 7:e005cfaff8d1 | 7 | float sigm(float input); |
sandwich | 0:ff9bc5f69c57 | 8 | |
sandwich | 0:ff9bc5f69c57 | 9 | class PololuMController |
sandwich | 0:ff9bc5f69c57 | 10 | { |
sandwich | 0:ff9bc5f69c57 | 11 | private: |
sandwich | 0:ff9bc5f69c57 | 12 | PwmOut* pwm; |
sandwich | 0:ff9bc5f69c57 | 13 | DigitalOut* outA; |
sandwich | 0:ff9bc5f69c57 | 14 | DigitalOut* outB; |
sandwich | 0:ff9bc5f69c57 | 15 | float timestamp; |
sandwich | 0:ff9bc5f69c57 | 16 | public: |
sandwich | 0:ff9bc5f69c57 | 17 | PololuMController(); |
sandwich | 0:ff9bc5f69c57 | 18 | PololuMController(PinName pwmport, PinName A, PinName B); |
sandwich | 0:ff9bc5f69c57 | 19 | ~PololuMController(); |
sandwich | 0:ff9bc5f69c57 | 20 | void setspeed(float speed); //0 to 1 |
sandwich | 0:ff9bc5f69c57 | 21 | void setpolarspeed(float speed); //-1 to 1 |
sandwich | 0:ff9bc5f69c57 | 22 | void reverse(); //only works on non-polar speed |
rkk | 6:a4d6f3e4bf28 | 23 | void drive_sinusoidal(float currentTime, float dutyCycle, float frequency); |
sandwich | 7:e005cfaff8d1 | 24 | void drive_rectangular(float currentTime, float amplitude, float frequency); |
sandwich | 0:ff9bc5f69c57 | 25 | }; |