Store the configuration on the SD card

This commit is contained in:
2015-08-13 14:10:09 +00:00
parent 53a8072424
commit d0f9f46f9c
16 changed files with 271 additions and 26 deletions

15
motor.c
View File

@@ -6,12 +6,14 @@
#include "uart.h"
#include "status.h"
#include "log.h"
#include "config.h"
float integral[3] = {0.0f, 0.0f, 0.0f};
float last[3];
float throttle = 0.0f;
#if 0
#define Kp 0.2
#define Ki 0.04
#define Kd 0.08
@@ -22,6 +24,19 @@ float throttle = 0.0f;
#define Kd_y 0.00
#define Ka_y 0.0
#else
#define Kp config.pid.rollpitch.p
#define Ki config.pid.rollpitch.i
#define Kd config.pid.rollpitch.d
#define Ka config.pid.rollpitch.a
#define Kp_y config.pid.yaw.p
#define Ki_y config.pid.yaw.i
#define Kd_y config.pid.yaw.d
#define Ka_y config.pid.yaw.a
#endif
/*
* Perform a PID loop iteration.