code_midgen
parent
e1b50fcf03
commit
e11b061226
12
src/game.cpp
12
src/game.cpp
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue