Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed 3875_Individualproject
Diff: main/main.cpp
- Revision:
- 31:1e6d0ef05996
- Parent:
- 30:d62f122e8d60
- Child:
- 32:598bedb22c7c
--- a/main/main.cpp Sun Apr 12 12:49:56 2020 +0000 +++ b/main/main.cpp Sun Apr 12 18:54:48 2020 +0000 @@ -207,17 +207,25 @@ coords_x[total_points] = curr_coords[0]; coords_y[total_points] = curr_coords[1]; - + update_index(); + + char buffer[1]; + + sprintf(buffer,"%x",type[curr_index]); + robot.lcd_clear(); + robot.lcd_print(buffer,1); + wait(0.5); } // use current coords to find which point to place in path - update_index(); + + looped_path[path_length] = point[curr_index]; //returns an int of which point we are at what its called choose_turn(); //looks at the point we are at, examines the type vs explored and makes the appropriate turn also updates the explored if (retrace) { // maybe do backtrack before choose turn? and put the retrace check in node logic - // back_track(); // if no node exists with unexplored paths, set complete to true true, else return to a previous node by going back through the path, increment the path length and add nodes appropriately and return false + back_track(); // if no node exists with unexplored paths, set complete to true true, else return to a previous node by going back through the path, increment the path length and add nodes appropriately and return false } if (complete) { @@ -252,7 +260,12 @@ // robot.lcd_print(xcors,100); // robot.lcd_goto_xy(0,1); // robot.lcd_print(ycors,100); - + +// robot.lcd_clear(); +// char *b = &dir; +// robot.lcd_print(b,1); + + //robot.display_data(); } @@ -420,9 +433,6 @@ if( unexp_paths == 0b0000 ) { retrace = true; - while(1) { - robot.stop(); - } } else {