Reading floating point in AnalogIN

30 Jun 2010

Hi ...

I wanted to know how to increase the no. of digits after decimal while reading floating value as Analog Input.i.e. present data available is in the form 0.123456 (from the range 0.000000 to 1.000000), i want my result to be displayed in range 0.0000000000 to 0.0123456789. Help needed please... I am working on the LPCmbed LPC1768 board...

30 Jun 2010

Hi Manohar,

You can certainly scale the value. Just multiplying by your scaling factor, such as:

AnalogIn a(p19);
float scaled_value = a * 0.1;
What you can't do is increase the "accuracy"; that is limited by the resolution of the ADC (12-bit on the LPC1768).

Thanks,
Simon