Main Site Documentation

Fez Mini Digital Input Error


#1

Hi,
I am receiving the following error when trying to set pin AN6 on the Fez Mini to a digital input. It is showing:
“An unhandled exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll”. My code is shown below. The problem happens at the line initializing pin An6 as ‘I3’. Any help is appreciated.
Thanks,
Tom

using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using GHIElectronics.NETMF.FEZ;

namespace FEZ_Mini_Application2
{
    public class Program
    {
        public static void Main()
        {
            // Blink board LED

            bool ledState = false;

            OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);
            OutputPort D10 = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.Di10, true);

            InputPort I1 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.An0, true, Port.ResistorMode.PullDown);
            InputPort I2 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.An1, true, Port.ResistorMode.PullDown);
            InputPort I3 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.An6, true, Port.ResistorMode.PullDown);
            InputPort I4 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.An7, true, Port.ResistorMode.PullDown);
            InputPort I5 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.An2, true, Port.ResistorMode.PullDown);
            InputPort I6 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.Di9, true, Port.ResistorMode.PullDown);
            InputPort I7 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.Di5, true, Port.ResistorMode.PullDown);
            InputPort I8 = new InputPort((Cpu.Pin)FEZ_Pin.Digital.Di6, true, Port.ResistorMode.PullDown);

#2

You can only enable glitch filter on inputs that are interrupt capable. Set it to false and you will be fine


#3

I love problems with simple answers. If only all of life were like the TINYCLR forum…