Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: IMU MODSERIAL Servo mbed
Fork of RTOS_Controller_v3 by
main.cpp
00001 // Continuously sweep the servo through it's full range 00002 #include "mbed.h" 00003 #include "vessel.h" 00004 //#include "MS5803.h" 00005 //MS5803 big_sensor = MS5803(I2C_SDA, I2C_SCL, ms5803_addrCH); 00006 00007 int main() 00008 { 00009 Timer t; 00010 wait(3); 00011 // Creates a vessel object called seagoat 00012 // The vessel object constains the controller, sensor updates, and reads 00013 // command sent from PC 00014 Vessel seagoat; //Starts the seagoat 00015 00016 // This section initializes PID gain 00017 seagoat.SetYawPID(1,0,0); 00018 seagoat.SetRollPID(1,0,0); 00019 seagoat.SetPitchPID(1,0,0); 00020 seagoat.SetXPID(0,0,0); 00021 seagoat.SetYPID(0,0,0); 00022 seagoat.SetZPID(0,0,0); 00023 00024 t.start(); 00025 while(t.read() < 4){ 00026 seagoat.calibrate(); 00027 00028 //pc.printf("%f \n", t.read()); 00029 } 00030 t.stop(); 00031 pc.printf("Seagoat Ready to Go\n\r"); 00032 //seagoat.motorTest(); 00033 float depth = 0; 00034 while(1) { 00035 //seagoat.motorTest(); 00036 seagoat.update(); 00037 //seagoat.updateCommand(); 00038 wait(0.01); 00039 } 00040 }
Generated on Wed Jul 13 2022 17:50:08 by
1.7.2
