After getting just 1023 for all readings, I tried to simply hook up the analog pin to ground and read the value in the loop. The reading should be zero every time but it is not.
Code in the main loop ...
AnalogInput inputPin = new AnalogInput(Pins.GPIO_PIN_A0); while (true) { Debug.Print(inputPin.Read().ToString()); Thread.Sleep(250); }
- When I use port A0 - I get values like 255,127 and a few 0 and 1023 values (not consistent)
- When I use port A1 or A2 - I get 1023 all the time.
Just to make things interesting .. I hookedup the ground from an arduino and it reads zero most of the time. It still reads an occasional 1023 reading.
To recreate - just hook a wire from Analog 0 to any ground and run the code. If you get zero every time .. I'd have to say hardware issue or version mismatch of some type?
This seemed like a pretty straight forward test but being brand new to this environment I figured I'd make my first newbie post