Main Site Documentation

Analog Input 0 problem with Rhino


#1

Hi,

When I connect AD0 (Pin4) to +3.3V and run sample code, I obtain :

[quote]206
3
193
93
87
48
61
90
61[/quote]

When I connect AD0 (Pin4) to GND and run sample code, I obtain :

[quote]0
0
0
0
0
0
0
0
0[/quote]

My sample test code

using System;
using System.Threading;
using Microsoft.SPOT;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;

namespace Test
{
    public class Program
    {
        public static void Main()
        {
            AnalogIn lightSensor = new AnalogIn((AnalogIn.Pin)FEZ_Pin.AnalogIn.AD0);
            lightSensor.SetLinearScale(0, 3300);

            int lightSensorReading = 0;
            while (true)
            {
                lightSensorReading = lightSensor.Read();
                Debug.Print(lightSensorReading.ToString());
                Thread.Sleep(500);
            }
        }

    }
}

If I try same test with AD1 I obtain excpected 3300 value for +3.3V and 0 for GND.

Why AD0 read wrong value ?


#2

Bad connection on that pin maybe?


#3

When you write I just try to re soldering my pin.

And now it’s work :slight_smile:

Thx for your answer.


#4

You are welcome! I am glad it is working. :slight_smile: