I am working in an embedded STM32F4 project and as a constraint i can only use integers.
I have already a working solution using floats.
#define TIMER_PERIOD 0.0000020833
float Get_Speed_Period(){
int tics = Get_Timer_Tics();
return tics * TIMER_PERIOD;
}
float Get_Rotation_Speed(float speed_period){
return (1 / speed_period * 64);
}
int main(){
float W = Get_Rotation_Speed ( Get_Speed_Period() );
return 0;
}
My goal is to only use integers. How can I achieve that ?
Thanks.