Expansion board for hoverboard firmware. Communicates to board via UART and Interfaces to Nunchucks, Gametraks, IMUs or wirelessly to itself.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
bewegungsappar.at_control/include/main.h

30 lines
803 B

#pragma once
#include <Arduino.h>
#include "config.h"
struct motorSetpoint {
double steer;
double pwm; // called "speed" in hoverboard firmware, but is only pwm duty cycle in promille
// Values from -1000 to 1000. Negative values represent driving backwards.
};
struct motorMeasured {
double actualSpeed_kmh; // motor speed in m/h
double actualSteer_kmh; // motor steer
};
struct motorControl {
motorSetpoint setpoint;
motorMeasured measured;
};
extern volatile motorControl motor;
extern bool debug;
extern volatile int32_t deltaMillis;
#ifdef DEBUG_PLOTTER
extern double plotterTempDouble[6];
#endif
void slowReset(volatile double &variable, double goal, double step, double fact);
void slowReset(int32_t &variable, double goal, int32_t step, double fact);