From e11b061226b5d83fd321db161d5fec53a299167c Mon Sep 17 00:00:00 2001 From: u-siri-ous Date: Mon, 2 Dec 2019 17:47:03 +0100 Subject: [PATCH] ao --- src/game.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 527fbd2..aa8be28 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -6,18 +6,22 @@ Game::Game(){ void Game::goalie(){ compass->readSensor(); + //drive->prepareDrive(0, 150, 0); digitalWrite(LED_G, HIGH); if(ball->ballSeen){ - if(ball->angle >= 0) { - drive->prepareDrive(0, 50, 0); - drive->drive(0, 50, 0); + if(ball->angle >= 0) drive->drive(0, 100, 0); + else if(ball->angle <= 45) drive->drive(45, 100, 0); + } else { + drive->prepareDrive(0, 0, 0); + drive->drive(0, 0, 0); } - } else drive->prepareDrive(0, 0, 0); } void Game::keeper(){ compass->readSensor(); digitalWrite(LED_Y, HIGH); + drive->prepareDrive(0, 0, 0); + drive->drive(0, 0, 0); }