Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update final_project.ino #26

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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