Controller for Seagoat in the RoboSub competition

Dependencies:   Servo mbed

Fork of ESC by Matteo Terruzzi

main.cpp

Committer:
gelmes
Date:
2016-07-26
Revision:
5:07bbe020eb65
Parent:
4:b37fd183e46a

File content as of revision 5:07bbe020eb65:

// Continuously sweep the servo through it's full range
#include "mbed.h"
#include "vessel.h"

int main()
{  
    Timer t;
    
    wait(3);
    Vessel seagoat; //Starts the seagoat
    seagoat.SetYawPID(4,0,0);  
    seagoat.SetRollPID(4,0,0);    
    seagoat.SetPitchPID(4,0,0);    
    seagoat.SetXPID(0,0,0);    
    seagoat.SetYPID(0,0,0);    
    seagoat.SetZPID(0,0,0);    
    
    t.start();
    while(t.read() < 5){
         seagoat.calibrate();
         
         //pc.printf("%f \n", t.read());
    }
    t.stop();
    pc.printf("Seagoat Ready to Go\n\r");
    //seagoat.motorTest();
    
    while(1) {
        
        //seagoat.motorTest();
        seagoat.update();
        
        wait(0.01);
    }
}