Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

andrewq2

Member Since 14 Sep 2010
Offline Last Active Sep 30 2010 10:11 PM
-----

Topics I've Started

Analog Input problem

14 September 2010 - 11:02 PM

I just got my netduino and I'm starting to try to get analog input and I always get 0 when I read my pin(A0). Do you see anything I did wrong?

My setup looks like this

3.3->AREF

A0->Photo Resistor->GND

public class Program
    {
        public static void Main()
        {
            // write your code here
            InterruptPort tester = new InterruptPort(Pins.GPIO_PIN_A0, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
            tester.Dispose();

            AnalogInput apin0 = new AnalogInput(Pins.GPIO_PIN_A0);
            apin0.SetRange(0, 100);

            int test = 0;
            while (true)
            {
                Thread.Sleep(250);
                test = apin0.Read();
                Debug.Print("Test: " + test);
            }

        }

    }

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.