Result = mV / 1000.0; // Will convert to float
The 32 bit analog input from your potentiometer can be mapped to the data range 0 - (2³²-1) which is essentially 4 bytes and unsigned int data type can easily accommodate this. However, if you want the data type to store decimal values, you can use the float data type which is also 4 bytes.
uint32 potentiometerInt; // Unsigned int
float potentiometerFloat //float
If you want to convert from one data type to another you can just type cast it.
potentiometerFloat = (float) potentiometerInt
I didn't understand what you meant by 0-5000V, the voltage of the potentiometer can't be of such high value, are you talking about the count? What do you mean by i made it 0 - 5000mV, please clarify.
Thank you so much
0-5000mV means my converted output from potantiometer input when my potantiometer ohm is nearly 0 my output voltage from potantiometer
is 5v so 5000mV
So i want to print float number on LCD i have got input from potantiometer and it is 32bit (int32) so data range
0 to (2^32-1) my problem is I cannot print after point(.) on LCD such as my converted output is 5,238V but I cannot printing ,238
on LCD my problem is this I can printing 5238mV but cannot that one
Thanks you much
and now how can i print float or double numbers on LCD i cannot printing after point( . )
suach as my float or double is 5,342 i cannot printing ,342
Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
I'm sorry man i fixed it now you were right I just forget change the heap size now is working thanks for your helpfull