I have the following setup:
- Fez domino
- I have a voltage divider on a breadboard
- 2K resistor (measured 1996) from GND to point (1)
- 10K resistor (measured 10021) from +3.3v to point(1)
- Analog connection from point(1) to AN3.
Using a voltmeter I assert that there’s 3.3v from GND to +3.3v (just to verify)
When my voltmeter measures GND to point(1) I get 0.546 millivolts
Now in code:
in = new AnalogIn(pin); in.SetLinearScale(0, 3300); int value = in.Read();
This code does NOT read 546.And does not match up to the voltmeter
However, when I connect the 3.3v directly to AN3 I get a proper reading of 3299.
Now, when I change both resistors to 10k it suddenly adds up (but then its not a voltage divider anymore)
Theres nothing else connected to the board.It seems the readout of the analog pin gets more off as the analog input goes to 0v.