Marco Rubio / Mbed 2 deprecated RTOS_Controller

Dependencies:   Servo mbed

Fork of ESC by Matteo Terruzzi

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