SPQR-Team-2019-REVAMPED/src/main.cpp

41 lines
737 B
C++
Raw Normal View History

2019-10-09 14:59:27 +02:00
#include <Arduino.h>
2019-12-02 17:25:22 +01:00
#define VARS
#include "behaviour_control/status_vector.h"
#include "sensors/sensors.h"
#include "strategy_roles/games.h"
#include "vars.h"
2020-10-29 17:19:20 +01:00
#include "test_menu.h"
TestMenu* testmenu;
2019-12-05 12:53:14 +01:00
void setup() {
delay(1500);
2020-01-27 17:05:39 +01:00
DEBUG.begin(9600);
for(int i = 0; i < 360; i++){
sins[i] = (float) sin((i*3.14/180));
cosins[i] = (float) cos((i*3.14/180));
}
2020-10-29 17:19:20 +01:00
testmenu = new TestMenu();
2020-02-05 19:46:57 +01:00
initStatusVector();
initSensors();
initGames();
2020-02-17 19:14:48 +01:00
delay(500);
}
void loop() {
updateSensors();
2020-10-29 17:19:20 +01:00
if(DEBUG.available()) testmenu->testMenu();
striker->play(role==1);
keeper->play(role==0);
2020-01-22 18:51:30 +01:00
2020-02-05 19:46:57 +01:00
// Last thing to do: movement and update status vector
drive->drivePrepared();
2020-02-05 19:46:57 +01:00
updateStatusVector();
2020-03-12 12:13:25 +01:00
}