diff --git a/src/game.cpp b/src/game.cpp index 05c974f..527fbd2 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -5,16 +5,18 @@ Game::Game(){ } void Game::goalie(){ + compass->readSensor(); digitalWrite(LED_G, HIGH); - //if(ball->ballSeen){ - //if(ball->angle >= 0) { - drive->prepareDrive(0, 150, 0); - drive->drive(0, 150, 0); - //} - //} else drive->prepareDrive(0, 0, 0); + if(ball->ballSeen){ + if(ball->angle >= 0) { + drive->prepareDrive(0, 50, 0); + drive->drive(0, 50, 0); + } + } else drive->prepareDrive(0, 0, 0); } void Game::keeper(){ + compass->readSensor(); digitalWrite(LED_Y, HIGH); } diff --git a/src/main.cpp b/src/main.cpp index 95f1375..5084296 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,13 +12,15 @@ void setup() { } void loop() { - updateSensors(); + //updateSensors(); /*if(millis() % 100 == 0) DEBUG_PRINT.println(us->getValue());*/ - if(game->role) game->goalie(); - else game->keeper(); + /* if(game->role) game->goalie(); + else game->keeper(); */ + game->goalie(); game->role = digitalRead(SWITCH_DX); game->attackGoal = digitalRead(SWITCH_SX); + //compass->test(); //usCtrl->test(); delay(200); } \ No newline at end of file