My modifications/additions to the code
Dependencies: ADXL345 ADXL345_I2C IMUfilter ITG3200 Servo fishgait mbed-rtos mbed pixy_cam
Fork of robotic_fish_ver_4_8 by
motor_controller.cpp
- Committer:
- sandwich
- Date:
- 2014-07-11
- Revision:
- 25:4f2f441eceec
- Parent:
- 12:7eeb29892625
File content as of revision 25:4f2f441eceec:
#include "motor_controller.h" PololuMController::PololuMController(PinName pwmport, PinName A, PinName B) :pwm(pwmport),outA(A),outB(B) { outA.write(0); outB.write(1); } void PololuMController::setpolarspeed(float speed) { if (speed>=0) { outA.write(0); outB.write(1); pwm.write(abs(speed)); } else { outA.write(1); outB.write(0); pwm.write(abs(speed)); } return; }