Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Anyone tried the example code for analog input read - on L476RG?
Scale of voltage readings is way off (code reports 51 Volts!).
http://www.emcu.it/NUCLEOevaBoards/mBed/QSG-Mbed-Library.pdf
I'm no expert but the code above seems to expect analog_value.read_u16() to be in the range 0 - 4095 (12bit)... ...it actually seems to range 0 - 65535. Is this just a question of where the ADC's 12 bits gets placed in the 16 bit uint_16?
I've tested shifting the ADC read to the right 4 bits and it seems to work with this !!correction!! : Result_V = ((MinStepRes * meas))/ ( !! 0x10 * !! 1000);