Voltages on PA4 oscillate from 2.0 to 2.6 volts, but the analogRead on PA4 going way off.
Here is the code
void setup() {
pinMode(PA4, INPUT_ANALOG);
Serial.begin(9600);
}
void loop() {
int analogValue = analogRead(PA4);
Serial.println(analogValue);
}
[Pito – Thu Oct 26, 2017 8:36 am] –
What are the resistor’s values ?
12 VCC(+-2) – 10k + 1.5K – GND
http://www.calculatoredge.com/electroni … divide.htm
How do you get 2.0 to 2.6V ? I’m not sure I understand your circuit.
[ahull – Thu Oct 26, 2017 9:49 am] –
If Vin is between 10 and 14 volts, Vout should be between 1.3 and 1.8V approx.http://www.calculatoredge.com/electroni … divide.htm
How do you get 2.0 to 2.6V ? I’m not sure I understand your circuit.
Could be, I saw the waves in oscilloscope, nothings goes above 3v and was around 2v. The voltage divider seems not the problem, but the analog values changing are. Voltage doesn’t go 0 at voltage divider while analogRead returns it.
Divider’s input voltage:

- Input Voltage.JPG (67.52 KiB) Viewed 522 times
then maybe AA+ to 1k/2k to gnd, pa4 to junction of the R’s
that should demonstrate or eliminate an analogue read problem, barring a bad crimp in the wires
stephen

