I am seriously confused. I am working on a project that requires the use of a linearization equation and I can't get the equation to work properly because any number less than 1 is converted to a zero even when using data type of float.
In a nutshell this is what I have:
float corrected_pwm;
unsigned int a = 35;
unsigned int b = 50
corrected_pwm = 6 * (a/b);
The variable "corrected_pwm" always comes back as zero because the division step (a/b) is being rounded to zero.
Can someone explain to me how I should be doing this?