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);
}
}
}
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.