code_midgen
u-siri-ous 2019-12-02 17:47:03 +01:00
parent e1b50fcf03
commit e11b061226
1 changed files with 8 additions and 4 deletions

View File

@ -6,18 +6,22 @@ Game::Game(){
void Game::goalie(){ void Game::goalie(){
compass->readSensor(); compass->readSensor();
//drive->prepareDrive(0, 150, 0);
digitalWrite(LED_G, HIGH); digitalWrite(LED_G, HIGH);
if(ball->ballSeen){ if(ball->ballSeen){
if(ball->angle >= 0) { if(ball->angle >= 0) drive->drive(0, 100, 0);
drive->prepareDrive(0, 50, 0); else if(ball->angle <= 45) drive->drive(45, 100, 0);
drive->drive(0, 50, 0); } else {
drive->prepareDrive(0, 0, 0);
drive->drive(0, 0, 0);
} }
} else drive->prepareDrive(0, 0, 0);
} }
void Game::keeper(){ void Game::keeper(){
compass->readSensor(); compass->readSensor();
digitalWrite(LED_Y, HIGH); digitalWrite(LED_Y, HIGH);
drive->prepareDrive(0, 0, 0);
drive->drive(0, 0, 0);
} }