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
main.cpp@19:655db88b045c, 2014-05-28 (annotated)
- Committer:
- rkk
- Date:
- Wed May 28 01:48:23 2014 +0000
- Revision:
- 19:655db88b045c
- Parent:
- 17:6970aef8154b
- Child:
- 20:6ae16da1492a
added yaw controller with adjustable frequency for either half to do a turning motion
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sandwich | 0:ff9bc5f69c57 | 1 | #include "mbed.h" |
sandwich | 2:430c068cf570 | 2 | #include "Servo.h" |
sandwich | 7:e005cfaff8d1 | 3 | //#include "rtos.h" |
rkk | 8:0574a5db1fc4 | 4 | //#include "PwmReader.h" |
rkk | 11:8ec915eb70f6 | 5 | //#include "PwmIn.h" |
rkk | 11:8ec915eb70f6 | 6 | #include "MainController.h" |
rkk | 6:a4d6f3e4bf28 | 7 | |
sandwich | 2:430c068cf570 | 8 | Serial pc(USBTX, USBRX); |
sandwich | 7:e005cfaff8d1 | 9 | Timer t; |
rkk | 11:8ec915eb70f6 | 10 | |
sandwich | 7:e005cfaff8d1 | 11 | int main() |
sandwich | 7:e005cfaff8d1 | 12 | { |
sandwich | 0:ff9bc5f69c57 | 13 | t.start(); |
rkk | 8:0574a5db1fc4 | 14 | |
rkk | 11:8ec915eb70f6 | 15 | MainController mainCtrl; |
rkk | 12:7eeb29892625 | 16 | |
rkk | 11:8ec915eb70f6 | 17 | mainCtrl.start(); |
rkk | 11:8ec915eb70f6 | 18 | |
rkk | 12:7eeb29892625 | 19 | while(true) { |
rkk | 11:8ec915eb70f6 | 20 | |
rkk | 19:655db88b045c | 21 | pc.printf("frq: %f, vol: %f, amp: %f, yaw: %f, dut: %f, pit: %f, tadd: %f, t: %f\n", |
rkk | 19:655db88b045c | 22 | mainCtrl.getFrequency(), mainCtrl.getVolume(), mainCtrl.getAmplitude(), mainCtrl.getYaw(), mainCtrl.getDutyCycle(), mainCtrl.getPitch(),mainCtrl.getTimeAdd(), t.read()); |
rkk | 12:7eeb29892625 | 23 | |
rkk | 11:8ec915eb70f6 | 24 | wait_ms(100); |
sandwich | 0:ff9bc5f69c57 | 25 | } |
rkk | 12:7eeb29892625 | 26 | //t.stop(); |
rkk | 12:7eeb29892625 | 27 | //mainCtrl.stop(); |
sandwich | 0:ff9bc5f69c57 | 28 | } |