Andrew Olguin / Mbed 2 deprecated RTOS_Controller_v2

Dependencies:   IMU MODSERIAL Servo mbed

Fork of RTOS_Controller by Marco Rubio

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

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     Vessel seagoat; //Starts the seagoat
00012     seagoat.SetYawPID(1,0,0);  
00013     seagoat.SetRollPID(1,0,0);    
00014     seagoat.SetPitchPID(1,0,0);    
00015     seagoat.SetXPID(0,0,0);    
00016     seagoat.SetYPID(0,0,0);    
00017     seagoat.SetZPID(0,0,0);    
00018     
00019     t.start();
00020     while(t.read() < 4){
00021          seagoat.calibrate();
00022          
00023          //pc.printf("%f \n", t.read());
00024     }
00025     t.stop();
00026     pc.printf("Seagoat Ready to Go\n\r");
00027     //seagoat.motorTest();
00028     float depth = 0;
00029     while(1) {
00030         //seagoat.motorTest();
00031         seagoat.update();
00032         seagoat.updateCommand();
00033         wait(0.01);
00034     }
00035 }