mirror of
https://github.com/okalachev/flix.git
synced 2025-07-29 12:28:59 +00:00
Move loopRate to time.ino
This commit is contained in:
parent
f9e1802bc0
commit
5530ad2981
@ -9,6 +9,7 @@
|
|||||||
extern PID rollRatePID, pitchRatePID, yawRatePID, rollPID, pitchPID;
|
extern PID rollRatePID, pitchRatePID, yawRatePID, rollPID, pitchPID;
|
||||||
extern LowPassFilter<Vector> ratesFilter;
|
extern LowPassFilter<Vector> ratesFilter;
|
||||||
extern const int MOTOR_REAR_LEFT, MOTOR_REAR_RIGHT, MOTOR_FRONT_RIGHT, MOTOR_FRONT_LEFT;
|
extern const int MOTOR_REAR_LEFT, MOTOR_REAR_RIGHT, MOTOR_FRONT_RIGHT, MOTOR_FRONT_LEFT;
|
||||||
|
extern float loopRate;
|
||||||
|
|
||||||
const char* motd =
|
const char* motd =
|
||||||
"\nWelcome to\n"
|
"\nWelcome to\n"
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
float t = NAN; // current step time, s
|
float t = NAN; // current step time, s
|
||||||
float dt; // time delta from previous step, s
|
float dt; // time delta from previous step, s
|
||||||
float loopRate; // loop rate, Hz
|
|
||||||
int16_t channels[RC_CHANNELS]; // raw rc channels
|
int16_t channels[RC_CHANNELS]; // raw rc channels
|
||||||
float controls[RC_CHANNELS]; // normalized controls in range [-1..1] ([0..1] for throttle)
|
float controls[RC_CHANNELS]; // normalized controls in range [-1..1] ([0..1] for throttle)
|
||||||
float controlsTime; // time of the last controls update
|
float controlsTime; // time of the last controls update
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
// Time related functions
|
// Time related functions
|
||||||
|
|
||||||
|
float loopRate; // Hz
|
||||||
|
|
||||||
void step() {
|
void step() {
|
||||||
float now = micros() / 1000000.0;
|
float now = micros() / 1000000.0;
|
||||||
dt = now - t;
|
dt = now - t;
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
float t = NAN;
|
float t = NAN;
|
||||||
float dt;
|
float dt;
|
||||||
float loopRate;
|
|
||||||
float motors[4];
|
float motors[4];
|
||||||
int16_t channels[16]; // raw rc channels
|
int16_t channels[16]; // raw rc channels
|
||||||
float controls[RC_CHANNELS];
|
float controls[RC_CHANNELS];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user