Kildekode til robot

Dependencies:   PID mbed

Fork of Robotkode by Kim Nielsen

Revision:
5:cf033e9d4468
Parent:
4:62a6681510d6
Child:
6:c2d4a02115db
--- a/robot.cpp	Wed Nov 23 21:40:26 2016 +0000
+++ b/robot.cpp	Thu Nov 24 09:14:48 2016 +0000
@@ -14,6 +14,8 @@
 #include "nucleo_servo.h"
 #include "hack_motor.h"
 #include <math.h> 
+#include "PID.h"
+
 
 void startfunction( );
 Ticker T1; // create an object T1 of Ticker
@@ -23,18 +25,13 @@
                                 MAIN FUNCTION
 ----------------------------------------------------------------------------*/
 int main()
-{
+{   
 /*
 =============================================================================
 Driving and stopping the robot with member functions from the wheel class
 =============================================================================*/
-    startfunction();    //  1. DRIVE  
-    while(Dtravel_1() <= DISTANCES[0])  //  OVERVEJ AT SMIDE "get_to_goal" funktionen ind i selve while loopet, sådan, at beregningerne sker parallelt. 
-    {
-        get_to_goal(); //   TJEK DETTE
-        robot.FW(0.5, 0.5);
-        wait_ms(5000);
-    }
+    startfunction();    //  1. DRIVE     
+    get_to_goal();
     
     robot.stop(); 
     printf("\n\rtimeused = %4d tickL= %4d  tickR = %4d \n", t.read_ms(),tickL,