changed mpu6050 code to class for better abstraction

This commit is contained in:
willem oldemans
2020-10-01 22:21:59 +02:00
parent c7fb9ff84b
commit 48b8cefac8
7 changed files with 113 additions and 98 deletions

View File

@@ -6,7 +6,7 @@
#include "lights.h"
#include "steeringCurves.h"
#include "balancing.h"
#include "MPU6050.h"
#include "MC34933.h"
#include "PWMFrequency.h"
@@ -121,7 +121,7 @@ bool motorBrakeActive(motor_t motor)
return getMotorptr(motor)->brakeActive();
}
void drive()
void drive(_mpu* mpu)
{
vehicleConfig* cfg = getConfigptr();
@@ -135,7 +135,7 @@ void drive()
case carwithMRSC:
{
mrsc(); // Car with MSRC stabilty control
mrsc(mpu); // Car with MSRC stabilty control
}
break;
@@ -147,7 +147,7 @@ void drive()
case balancingthing:
{
balancing(); // Self balancing robot
balancing(mpu); // Self balancing robot
}
break;