hamsiii
Member level 2
Hi all,
I have a problem of acquiring ADC data. The data should be 562 and constant, stored in ADC (10bit) memory.
To calculate the exact voltage (which is 2.74V), the operation is;
However, at this point, I get 32 for x and 0 for y as I should get 32.99... for x and 2.74... for y. Dividing operators do not provide me any decimals and they round the number down. Would please help me to avoid this and get the exact numbers?
I would not use printf, instead I will send the data into LCD. So, the %.2f function will not be any use for me. So, the data will be stored in a specifier like float or int.
I have a problem of acquiring ADC data. The data should be 562 and constant, stored in ADC (10bit) memory.
To calculate the exact voltage (which is 2.74V), the operation is;
Code:
float x = (ADC_Result*60)/1022;
float y = (x*5)/60;
I would not use printf, instead I will send the data into LCD. So, the %.2f function will not be any use for me. So, the data will be stored in a specifier like float or int.