Hi my adc is very unstable i only probe read a value from a potentiometer conected to 3.3v and gnd and one lcd to present the value
in the lcd i can read the value between 0.0 to 1.0 and read well for example 0,5.... but it chages to 1,00 and return 0,5... and repeat and repeat, the same thing happen when i conecct the input to groun the value is 0,000 and change to 1,000
the code is
#include "mbed.h"
#include "TextLCD.h"
TextLCD lcd(p5, p6, p7, p8, p9, p10);
PwmOut out(p21);
AnalogIn vel(p16);
DigitalOut out1(p27);
DigitalOut out2(p28);
int main() {
out1=1;
out2=0;
while(1) {
out=vel.read();
lcd.locate(0,1);
lcd.printf("%0.3f ",vel.read());
wait(0.3);
}
}
i also probe without lcd only with adc and pwm to LED1 and i have the same
please help me thanks
Hi,
I was testing the analog input. A few weeks ago i also tested is, and readout was fine. But now it is unstable. I give it 3.3Vin , and the readout varies between 2V and 5V.
code:
Any thoughts about whats going on?