speed kartculator
This commit is contained in:
parent
863977e20f
commit
9b304aec93
@ -21,7 +21,15 @@ void calcPosition(uint8_t joy_pos){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void calcSpeed(int32_t rpm) {
|
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() {
|
int16_t getTorque() {
|
||||||
|
Reference in New Issue
Block a user