Robosub controller
Dependencies: IMU MODSERIAL Servo mbed
Fork of RTOS_Controller by
main.cpp@7:396fa2a8648d, 2016-07-29 (annotated)
- Committer:
- aolgu003
- Date:
- Fri Jul 29 15:34:59 2016 +0000
- Revision:
- 7:396fa2a8648d
- Parent:
- 6:b45b74fd6a07
Fixed issues and integrated with the sub.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gelmes | 3:5ffe7e9c0bb3 | 1 | // Continuously sweep the servo through it's full range |
gelmes | 3:5ffe7e9c0bb3 | 2 | #include "mbed.h" |
gelmes | 3:5ffe7e9c0bb3 | 3 | #include "vessel.h" |
aolgu003 | 7:396fa2a8648d | 4 | //#include "MS5803.h" |
aolgu003 | 7:396fa2a8648d | 5 | //MS5803 big_sensor = MS5803(I2C_SDA, I2C_SCL, ms5803_addrCH); |
aolgu003 | 6:b45b74fd6a07 | 6 | |
gelmes | 3:5ffe7e9c0bb3 | 7 | int main() |
gelmes | 3:5ffe7e9c0bb3 | 8 | { |
gelmes | 5:07bbe020eb65 | 9 | Timer t; |
gelmes | 5:07bbe020eb65 | 10 | wait(3); |
gelmes | 3:5ffe7e9c0bb3 | 11 | Vessel seagoat; //Starts the seagoat |
aolgu003 | 7:396fa2a8648d | 12 | seagoat.SetYawPID(1,0,0); |
aolgu003 | 7:396fa2a8648d | 13 | seagoat.SetRollPID(1,0,0); |
aolgu003 | 7:396fa2a8648d | 14 | seagoat.SetPitchPID(1,0,0); |
gelmes | 5:07bbe020eb65 | 15 | seagoat.SetXPID(0,0,0); |
gelmes | 5:07bbe020eb65 | 16 | seagoat.SetYPID(0,0,0); |
gelmes | 5:07bbe020eb65 | 17 | seagoat.SetZPID(0,0,0); |
gelmes | 5:07bbe020eb65 | 18 | |
gelmes | 5:07bbe020eb65 | 19 | t.start(); |
aolgu003 | 7:396fa2a8648d | 20 | while(t.read() < 4){ |
gelmes | 5:07bbe020eb65 | 21 | seagoat.calibrate(); |
gelmes | 5:07bbe020eb65 | 22 | |
gelmes | 5:07bbe020eb65 | 23 | //pc.printf("%f \n", t.read()); |
gelmes | 5:07bbe020eb65 | 24 | } |
gelmes | 5:07bbe020eb65 | 25 | t.stop(); |
gelmes | 5:07bbe020eb65 | 26 | pc.printf("Seagoat Ready to Go\n\r"); |
gelmes | 5:07bbe020eb65 | 27 | //seagoat.motorTest(); |
aolgu003 | 7:396fa2a8648d | 28 | float depth = 0; |
gelmes | 4:b37fd183e46a | 29 | while(1) { |
gelmes | 5:07bbe020eb65 | 30 | //seagoat.motorTest(); |
gelmes | 4:b37fd183e46a | 31 | seagoat.update(); |
aolgu003 | 6:b45b74fd6a07 | 32 | seagoat.updateCommand(); |
gelmes | 5:07bbe020eb65 | 33 | wait(0.01); |
gelmes | 4:b37fd183e46a | 34 | } |
gelmes | 3:5ffe7e9c0bb3 | 35 | } |