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.
9 years, 9 months ago.
AnalogIn value too low?
On the NUCLEO-F303K8 when measuring volt, value is 5% - 6% below correct value.
Same code on NUCLEO-F446RE gives correct value.
#include "mbed.h"
// Initialize a pins to perform analog input and digital output fucntions
AnalogIn ain(A1);
int main(void)
{
float verdi;
while (1) {
verdi = ain.read();
printf("percentage: %3.3f%%\n", verdi*100.0f);
printf("volt: %3.3f\n\n", verdi*3.321f); //Multimeter value on AREF = 3.321
wait(1);
}
}
Question relating to:
1 Answer
9 years, 9 months ago.
I can confirm they do seem quite a bit out - is there any solution for this yet?
I have a similar problem on a 103 board. There is an STM 'Start Calibrate()' function in CMSIS, and if you use an old mbed version (pre 95 I think) you can access it and it works well (within 10mV). The problem is that the move to HAL breaks this, and I don't know how to call HAL function - anyone else know?.
posted by 17 Nov 2016