Skip to content

Commit

Permalink
Merge pull request #26 from tiffanalin/tiffany_edits
Browse files Browse the repository at this point in the history
Update final_project.ino
  • Loading branch information
tiffanalin authored Jan 11, 2023
2 parents a833c50 + 17d1758 commit 396b791
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions final_project/final_project.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
/**
* Pololu Zumo Robot with Obstacle Avoidance
*
* by Clemence, Romaric & Tiffany
*
* This robot will travel from start to goal in a 8x8 grid while
* avoiding known obstacles placed on the grid.
*
*/
*/

// import library
#include <ZumoShield.h>

Expand Down Expand Up @@ -39,7 +40,6 @@ int grid[X][Y]= {
{0,0,0,1,1,0,0,0},
};

*/


void setup() {
Expand Down Expand Up @@ -67,13 +67,13 @@ int path[PATH_LEN][2] = {
{7,7}
};

/*
goPath,
This function moves the robot to the next location in the path.
inputs = currentX: x current location, currentY: y current location, nextX: next x location, nextY: next y location
output = status of our followed path (3 for goal reached, 2 if obstacle detected, 1 for no direction
/**
goPath,
This function moves the robot to the next location in the path.
inputs = currentX: x current location, currentY: y current location, nextX: next x location, nextY: next y location
output = status of our followed path (3 for goal reached, 2 if obstacle detected, 1 for no direction
*/

int goPath(int currentX,int currentY,int nextX,int nextY ){

int returnValue = 1;
Expand Down Expand Up @@ -112,11 +112,11 @@ int goPath(int currentX,int currentY,int nextX,int nextY ){

}

/*
goNext,
Depending on the current position, the robot moves to the next square on the grid.
input = x: x current, y: y current, w: x next, z: y next
output = f: front, b:back, l:left, r:right
/**
goNext,
Depending on the current position, the robot moves to the next square on the grid.
input = x: x current, y: y current, w: x next, z: y next
output = f: front, b:back, l:left, r:right
*/
char goNext(int x,int y,int w,int z){

Expand Down Expand Up @@ -198,7 +198,7 @@ void turnRight(){
int count = 0;

void loop() {
//
// setting currentX and currentY variables to path values in PATH_LEN and goPath is called
if(count == 0){
for(int i = 0; i < PATH_LEN -1 ; i++){
int currentX = path[i][0];
Expand Down

0 comments on commit 396b791

Please sign in to comment.