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
Diff: main.cpp
- Revision:
- 0:ff9bc5f69c57
- Child:
- 1:80e0af42f876
- Child:
- 2:430c068cf570
diff -r 000000000000 -r ff9bc5f69c57 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jan 21 21:32:05 2014 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "motor_controller.h" +#include "IMU.h" + +PololuMController mcon(p22, p6, p5); +IMU imu(0.1, 0.3, 0.005, 0.005); + +int main() { + Timer t; + t.start(); + while(1) { + /* if (speed>=1) + { + speed=0; + mcon.reverse(); + } + mcon.setspeed(speed); + */ + mcon.drive_sinusoidal(t.read(), 1, 0.25*3.14, 0); + wait(0.2); + } + t.stop(); +}