Digital input pin configuration

I am trying to run the basic example (Spider) below but having problems.

This assembly is not recognized (GHI.Premium.Hardware).
When using ( GHIElectronics.NETMF.Hardware) then “EMX” is not recognized in such context!

I tried to switch to using sockets (new GT.Interfaces.DigitalInput) but I was asked to define a value for “GTM.Model.module”. I googled and couldn’t find anything, I have no idea what it is! Before that I googled to find an answer to what a “glitchfilter” is, but found no info about it till I spotted it by coincidence in an answer here.

What is it that I am doing wrong here? Why can’t I find related info?

Regards

Trevor

[quote]using System;
using Microsoft.SPOT;
using System.Threading;
using Microsoft.SPOT.Hardware;
using GHI.Premium.Hardware;

namespace MFConsoleApplication1
{
public class Program
{
public static void Main()
{
OutputPort LED;
InputPort Button;

        LED = new OutputPort((Cpu.Pin)EMX.Pin.IO47, true);
        Button = new InputPort((Cpu.Pin)EMX.Pin.IO33, false, Port.ResistorMode.PullUp);

        while (true)
        {
            LED.Write(Button.Read());
            Thread.Sleep(10);
        }
    }
}

} [/quote]

Looks like you are missing a reference to that assembly. Check “References” in the Solution Explorer in VS.

Also make sure you have latest firmware GHIElectronics.NETMF.Hardware is the old one from 4.1.

And please use code tags when adding code snippets.

@ Architect - Hi

“Check “References” in the Solution Explorer in VS.”

  • I looked but I don’t know which specific ref is responsible for (GHI.Premium.Hardware)? Nothing looks close to it.

“Also make sure you have latest firmware GHIElectronics.NETMF.Hardware is the old one from 4.1.”

  • My whole project is done in 4.1.

“And please use code tags when adding code snippets.”

  • M apologies I don’t know how to do it as there is no example here?

  • What is “GTM.Model.module” please, and what value should it have for connection a button to the pin (pull up)?

Thanks.

Did you install the GHI SDK?
http://www.ghielectronics.com/download/ghi-software-package-v4.2-11292012
and
http://www.ghielectronics.com/download/ghi-netmf-v4.1-sdk

Any Exception or any error during debug or compile…please post that also…

Regards YuvaRaja

Thank you everyone for your answers. It works now.

1- With regard to using “InputPort((Cpu.Pin)EMX.Pin.IO46,…”, I had a reference missing. Namely “GHIElectronics.NETMF.Hardware.EMX”. I think such info should be clearly available in documentation. I couldn’t find it (yes it was late and I was sleepy). In Java in Eclipse, the compiler suggests to which assembly to use.

2- Still don’t know what the parameter “GTM.Model.module” is in “new GT.Interfaces.DigitalInput(…)”? Couldn’t find anything about it !

That can be set to NULL. It is used if you write a driver for a module. If you are coding inside a module driver then that can be “this” as the module class is of type GTM.Module.

Thanks :slight_smile: All.