Updated version with comments
Dependencies: IMU MODSERIAL Servo mbed
Fork of RTOS_Controller_v3 by
main.cpp
- Committer:
- aolgu003
- Date:
- 2016-12-12
- Revision:
- 11:1b838130dc8c
- Parent:
- 9:9aaa7f0c8960
File content as of revision 11:1b838130dc8c:
// Continuously sweep the servo through it's full range #include "mbed.h" #include "vessel.h" //#include "MS5803.h" //MS5803 big_sensor = MS5803(I2C_SDA, I2C_SCL, ms5803_addrCH); int main() { Timer t; wait(3); // Creates a vessel object called seagoat // The vessel object constains the controller, sensor updates, and reads // command sent from PC Vessel seagoat; //Starts the seagoat // This section initializes PID gain seagoat.SetYawPID(1,0,0); seagoat.SetRollPID(1,0,0); seagoat.SetPitchPID(1,0,0); seagoat.SetXPID(0,0,0); seagoat.SetYPID(0,0,0); seagoat.SetZPID(0,0,0); t.start(); while(t.read() < 4){ seagoat.calibrate(); //pc.printf("%f \n", t.read()); } t.stop(); pc.printf("Seagoat Ready to Go\n\r"); //seagoat.motorTest(); float depth = 0; while(1) { //seagoat.motorTest(); seagoat.update(); //seagoat.updateCommand(); wait(0.01); } }