2019-10-09 14:59:27 +02:00
|
|
|
#include <Arduino.h>
|
2019-12-02 17:25:22 +01:00
|
|
|
|
2019-12-09 19:08:05 +01:00
|
|
|
#include "sensors.h"
|
|
|
|
#include "games.h"
|
2020-02-05 19:46:57 +01:00
|
|
|
#include "status_vector.h"
|
2020-02-17 17:42:58 +01:00
|
|
|
#include "positionsys_zone.h"
|
2019-12-05 12:53:14 +01:00
|
|
|
|
2019-12-05 13:31:21 +01:00
|
|
|
void setup() {
|
2020-01-31 13:35:40 +01:00
|
|
|
delay(1500);
|
2019-12-05 13:31:21 +01:00
|
|
|
|
2020-01-27 17:05:39 +01:00
|
|
|
DEBUG.begin(9600);
|
2020-02-05 19:46:57 +01:00
|
|
|
initStatusVector();
|
2019-12-05 13:31:21 +01:00
|
|
|
initSensors();
|
2019-12-09 19:08:05 +01:00
|
|
|
initGames();
|
|
|
|
|
2020-02-17 19:14:48 +01:00
|
|
|
delay(500);
|
2019-12-05 13:31:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
updateSensors();
|
2020-02-05 19:46:57 +01:00
|
|
|
|
2019-12-09 19:08:05 +01:00
|
|
|
goalie->play(role==1);
|
2020-01-22 18:51:30 +01:00
|
|
|
keeper->play(role==0);
|
|
|
|
|
2020-02-05 19:46:57 +01:00
|
|
|
// Last thing to do: movement and update status vector
|
2020-01-26 20:13:31 +01:00
|
|
|
drive->drivePrepared();
|
2020-02-05 19:46:57 +01:00
|
|
|
updateStatusVector();
|
2019-12-05 13:31:21 +01:00
|
|
|
}
|