Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
MotorController.c
Go to the documentation of this file.
1#include "../../../Inc/Systems/External/MotorController.h"
2
4 if (mc != NULL) {
5 mc->esc = esc;
6 mc->app = app;
7 }
8}
9
11 if (mc && mc->app) {
12 return getAppPosition(mc->app);
13 }
14 return 0.0; // Return default value if no app
15}
16
17float getMotorTemp(const MotorController* mc) {
18 if (mc && mc->esc) {
19 return getEscTemp(mc->esc);
20 }
21 return 0.0; // Return default value if no esc
22}
float getAppPosition(App *app)
Gets the current position of the APP.
Definition: App.c:11
float getEscTemp(const Esc *esc)
Gets the temperature of the ESC.
Definition: Esc.c:19
void initMotorController(MotorController *mc, Esc *esc, App *app)
Initializes the MotorController with the given ESC and APP.
float getMotorTemp(const MotorController *mc)
Gets the motor temperature from the MotorController.
float getPedalPosition(const MotorController *mc)
Gets the pedal position from the MotorController.
Definition: App.h:6
Definition: Esc.h:6