going straight...slowly
parent
c346312bc9
commit
e1b50fcf03
14
src/game.cpp
14
src/game.cpp
|
@ -5,16 +5,18 @@ Game::Game(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::goalie(){
|
void Game::goalie(){
|
||||||
|
compass->readSensor();
|
||||||
digitalWrite(LED_G, HIGH);
|
digitalWrite(LED_G, HIGH);
|
||||||
//if(ball->ballSeen){
|
if(ball->ballSeen){
|
||||||
//if(ball->angle >= 0) {
|
if(ball->angle >= 0) {
|
||||||
drive->prepareDrive(0, 150, 0);
|
drive->prepareDrive(0, 50, 0);
|
||||||
drive->drive(0, 150, 0);
|
drive->drive(0, 50, 0);
|
||||||
//}
|
}
|
||||||
//} else drive->prepareDrive(0, 0, 0);
|
} else drive->prepareDrive(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::keeper(){
|
void Game::keeper(){
|
||||||
|
compass->readSensor();
|
||||||
digitalWrite(LED_Y, HIGH);
|
digitalWrite(LED_Y, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,15 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
updateSensors();
|
//updateSensors();
|
||||||
/*if(millis() % 100 == 0)
|
/*if(millis() % 100 == 0)
|
||||||
DEBUG_PRINT.println(us->getValue());*/
|
DEBUG_PRINT.println(us->getValue());*/
|
||||||
if(game->role) game->goalie();
|
/* if(game->role) game->goalie();
|
||||||
else game->keeper();
|
else game->keeper(); */
|
||||||
|
game->goalie();
|
||||||
game->role = digitalRead(SWITCH_DX);
|
game->role = digitalRead(SWITCH_DX);
|
||||||
game->attackGoal = digitalRead(SWITCH_SX);
|
game->attackGoal = digitalRead(SWITCH_SX);
|
||||||
|
//compass->test();
|
||||||
//usCtrl->test();
|
//usCtrl->test();
|
||||||
delay(200);
|
delay(200);
|
||||||
}
|
}
|
Loading…
Reference in New Issue