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@25:4f2f441eceec, 2014-07-11 (annotated)
- Committer:
- sandwich
- Date:
- Fri Jul 11 14:30:36 2014 +0000
- Revision:
- 25:4f2f441eceec
- Parent:
- 24:9d75ed1462d6
latest revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sandwich | 0:ff9bc5f69c57 | 1 | #include "mbed.h" |
sandwich | 24:9d75ed1462d6 | 2 | //#include "rtos.h" |
sandwich | 2:430c068cf570 | 3 | #include "Servo.h" |
sandwich | 7:e005cfaff8d1 | 4 | //#include "rtos.h" |
rkk | 8:0574a5db1fc4 | 5 | //#include "PwmReader.h" |
rkk | 11:8ec915eb70f6 | 6 | //#include "PwmIn.h" |
rkk | 11:8ec915eb70f6 | 7 | #include "MainController.h" |
sandwich | 2:430c068cf570 | 8 | Serial pc(USBTX, USBRX); |
sandwich | 24:9d75ed1462d6 | 9 | //Serial syren(p9,p10); //syren replaced the pololu controller |
sandwich | 7:e005cfaff8d1 | 10 | Timer t; |
rkk | 11:8ec915eb70f6 | 11 | |
sandwich | 7:e005cfaff8d1 | 12 | int main() |
sandwich | 7:e005cfaff8d1 | 13 | { |
sandwich | 24:9d75ed1462d6 | 14 | //syren.baud(38400); |
sandwich | 0:ff9bc5f69c57 | 15 | t.start(); |
sandwich | 22:807d5467fbf6 | 16 | |
rkk | 11:8ec915eb70f6 | 17 | MainController mainCtrl; |
sandwich | 22:807d5467fbf6 | 18 | |
rkk | 11:8ec915eb70f6 | 19 | mainCtrl.start(); |
rkk | 11:8ec915eb70f6 | 20 | |
sandwich | 24:9d75ed1462d6 | 21 | printf("started\n"); |
rkk | 12:7eeb29892625 | 22 | while(true) { |
sandwich | 25:4f2f441eceec | 23 | //pc.printf("control: %d, frq: %.3f, vol: %.2f, amp: %.3f, yaw: %.2f, dut: %.2f, pit: %.2f, adj: %.2f, t: %.2f\n", |
sandwich | 25:4f2f441eceec | 24 | // mainCtrl.getOpMode(), mainCtrl.getFrequency(), mainCtrl.getVolume(), mainCtrl.getAmplitude(), mainCtrl.getYaw(), mainCtrl.getDutyCycle(), mainCtrl.getPitch(), mainCtrl.getAdj(), t.read()); |
rkk | 12:7eeb29892625 | 25 | |
sandwich | 24:9d75ed1462d6 | 26 | //syren.putc(int(mainCtrl.getDutyCycle())); |
sandwich | 25:4f2f441eceec | 27 | //wait_ms(100); |
sandwich | 0:ff9bc5f69c57 | 28 | } |
rkk | 12:7eeb29892625 | 29 | //t.stop(); |
rkk | 12:7eeb29892625 | 30 | //mainCtrl.stop(); |
sandwich | 0:ff9bc5f69c57 | 31 | } |