James Heavey / Mbed 2 deprecated 3875_DISSERTATION

Dependencies:   mbed 3875_Individualproject

Revision:
50:fa124ea1df9f
Parent:
49:89f0f54aa46b
Child:
51:3148875bb9e5
--- a/main/main.cpp	Fri Apr 17 14:45:13 2020 +0000
+++ b/main/main.cpp	Fri Apr 17 16:07:23 2020 +0000
@@ -651,14 +651,14 @@
     
     for( int x = 0; x <= path_length; x++ ) { shortest[x] = NULL; }
     
-    for( int i = index1; i <= index2; i++ ) { shortest[i] = looped_path[i]; }
+    for( int i = index1; i <= index2; i++ ) { shortest[i-index1] = looped_path[i]; }
     
     int length = index2 - index1;
     
     char buffer[3];
     sprintf(buffer,"%d", length);
     robot.lcd_print(buffer,3);
-    wait(3);
+    wait(2);
     robot.lcd_clear();
     
     // for every node in path, check if repeated
@@ -668,7 +668,6 @@
     // or end when iterated through the entire array
     
     int i = 0;
-    
     while( i <= length ) {
         int count = i;
         for( int j = 0; j <= length; j++ ) {
@@ -705,7 +704,7 @@
         char buffer[3];
         sprintf(buffer,"%d", shortest[m]);
         robot.lcd_print(buffer,3);
-        wait(3);
+        wait(2);
         robot.lcd_clear();
     }
     
@@ -989,8 +988,16 @@
     // loop between start and goal
     robot.stop();
     dead_end_removal( point[0], point[total_points] );
-//    simplify_looped();
-    
+    leds = 0b1001;
+        wait(0.2);
+        leds = 0b0110;
+        wait(0.2);
+    dead_end_removal( point[3], point[4] );
+    leds = 0b1001;
+        wait(0.2);
+        leds = 0b0110;
+        wait(0.2);
+    dead_end_removal( point[2], point[4] );
     while( button_enter.read() == 1 ) {
         leds = 0b1001;
         wait(0.2);