Main Site Documentation

AD Pins


#1

Are all pins capable of adc?


#2

no, please see brochure for the analog pins. Of course I do not know which product your talking about.


#3

g120…i think i found out…is see there are pins AD1-AD7 which are the ADC pins


#4

Looking at the analog input example i should be able to use lightSensor.SetLinearScale(0, 100); but it is not recognised


    using System.Threading;
    using Microsoft.SPOT;
    using Microsoft.SPOT.Hardware;
     
    namespace change_this_to_your_namespace
    {
       public class Program
       {
          public static void Main()
          {
             AnalogInput lightSensor = new AnalogInput((Cpu.AnalogChannel)Cpu.AnalogChannel.ANALOG_7);
             double lightSensorReading = 0;
     
             while (true)
             {
                 lightSensor.SetLinearScale(0, 100); //method not recognised
                lightSensorReading = lightSensor.Read();
                Debug.Print(lightSensorReading.ToString());
                Thread.Sleep(500);
             }
          }
       }
    }


#5

That is an old 4.1 API
Check this thread:

https://www.ghielectronics.com/community/forum/topic?id=12902