5 years, 10 months ago.

Cannot read any values from analogIn pins

I have written a simple little program to print out the float value from any analog input like this:

AnalogIn pot(PA_1);

and in the main inside a while(1) i print pot.read() to tera term

but i only get values like 0.000488 and no matter how much i turn the pot meter it doesnt change.

the program and connection works perfectly with the LPC1768 but it won't work with the L476VG

Question relating to:

The 32L476GDISCOVERY helps users to develop and share applications with the STM32L4 ultra-low-power microcontrollers.

1 Answer

5 years, 10 months ago.

If you import this example and don't update the Mbed library it will work, just tried. Stopped working when I updated Mbed Libraries.

https://os.mbed.com/teams/ST/code/STM32_ADC_InternalChannels/

I would suggest you report this as a bug.

Just checked, works fine on Mbed OS5