AKUL check if this has the correct right and left turning, if not replace it Code with lots of comments
Fork of Working_on_Left_and_Right by
Diff: main.cpp
- Revision:
- 9:accfae3aaf72
- Parent:
- 8:d5a5d104996e
- Child:
- 10:e2267771f7d4
--- a/main.cpp Tue Jun 03 12:48:53 2014 +0000 +++ b/main.cpp Wed Jun 04 11:38:06 2014 +0000 @@ -46,7 +46,7 @@ //finds the directions of the robot int startpt = 2; //start(); - int endpt = 4; //end(); + int endpt = 1; //end(); string d = directions(startpt, endpt); int turns = 0; @@ -172,8 +172,8 @@ //gives the string to use for the map string directions(int startpoint, int endpoint){ string charmap[6][6] = { - {"", "RLLR", "RLFF", "RRRLLF", "RRLFLRRRL", "RRLR"}, - {"LRRL", "", "LLF", "LLRL", "LFRLRRL", "LRFLR"}, + {"", "RLRLLR", "RLRLFF", "RLRRRLLF", "RLRRLFLRRRL", "RLRRLR"}, + {"LRRLR", "", "LLF", "LLRLL", "LFRLRRL", "LRFLR"}, {"FFRL", "FRR", "", "LL", "FLRLRRL", "FFFLR"}, {"FRRLRL", "RLRR", "RR", "", "FFRL", "FRLRL"}, {"RLLLRFRLL", "RLLRLFR", "RLFLR", "RLFF", "", "RLLLRL"}, @@ -214,7 +214,7 @@ void turn_left(){ int n=0; wait(.08); - while (n<850){ + while (n<700){ thinggy.left_motor(-0.2); thinggy.right_motor(0.2); n++; @@ -227,7 +227,7 @@ void turn_right(){ int n=0; wait(.08); - while (n<850){ + while (n<700){ thinggy.left_motor(0.2); thinggy.right_motor(-0.2); n++;