speed kartculator

This commit is contained in:
Rémi Heredero 2023-09-01 16:37:46 +02:00
parent 863977e20f
commit 9b304aec93

View File

@ -21,7 +21,15 @@ void calcPosition(uint8_t joy_pos){
}
void calcSpeed(int32_t rpm) {
int32_t calcSpeed;
if(rpm>=0){
calcSpeed = rpm;
} else {
calcSpeed = -rpm;
}
calcSpeed *= 1000;
calcSpeed /= KART_CST.CONTROL_SPEED_FACTOR;
eKart.speed = (uint8_t) calcSpeed;
}
int16_t getTorque() {