27 lines
933 B
C++
27 lines
933 B
C++
// This is a personal academic project. Dear PVS-Studio, please check it.
|
|
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: https://pvs-studio.com
|
|
|
|
#include "App.hpp"
|
|
#include "BoardI2C.hpp"
|
|
|
|
#define IGNORE_CHARGE true
|
|
|
|
BoardI2C i2c;
|
|
|
|
static Application *app = nullptr;
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
app = new Application(new FlightDispatcher(
|
|
new BluetoothDispatcher(new BluetoothSerial()),
|
|
new FlightController(
|
|
new Sensors(new Barometer(new GyverBME280(i2c)), new MPU(new MPU6050(MPU6050_DEFAULT_ADDRESS, &i2c)),
|
|
new Kalman2DFilter(10.f, 1.f, 1.8f), new BatteryController()),
|
|
new PIDController(1.f, 1.f, 1.f, new BrushedMotor(1, 2, 3, 4, 1), 1),
|
|
new PIDController(1.f, 1.f, 1.f, new BrushedMotor(1, 2, 3, 4, 2), 2),
|
|
new PIDController(1.f, 1.f, 1.f, new BrushedMotor(1, 2, 3, 4, 3), 3), IGNORE_CHARGE)));
|
|
}
|
|
|
|
void loop() {
|
|
app->tick();
|
|
} |