Hydra (NETMF 4.1) - Change code to use IO60P16 Module

Hi, I’ve been reading the threads about IO60P16 module, but still do not understand how to change the following code, to use the module mentioned.

This is the actual code.



private InterruptPort reader11;

GT.Socket socket = GT.Socket.GetSocket(9, true, null, null);

var pin1 = socket.ReservePin(Gadgeteer.Socket.Pin.Three, null);

reader11 = new InterruptPort(pin1, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);

// Asign the Interrup Event
reader11.OnInterrupt += new NativeEventHandler(reader11_OnInterrupt);

// This is the Interrupt Event code
void reader11_OnInterrupt(uint data1, uint data2, DateTime time)
{
    if (data2 == 0)
    {
         reader1count++;
         reader1card = reader1card << 1;
     }
    reader1_Initialize();
}


I need to change this code, to use a one port and pin in the IO6016P module, the reason for change is that I need to raise the number of pins,
which can receive readings when this will be generated by the sensors.

Thanks in advanced.

lerg98

You can’t do this with 4.1 on a Hydra. There’s a brand new driver for the IO60P16 coming in the next SDK release (soon) which we have not seen yet. So, you’ll have to wait until it’s released.

1 Like

From what he had been reading, I figured that would be the answer as you mention.

Ian, is there any way to integrate the driver version you mentioned, to the current beta (4.2 qfe2)?

Thanks in advanced.

lerg98

GHI hasn’t made the source available yet. So, you’ll have to hang tight. They hinted that it would only be a few days more.

Hi Ian, you know if the new driver for IO60P16 module was integrated in this latest update?

Thanks in advance.

lerg98

Sadly, I have not yet had time to check out the new SDK that was released on Friday. So, I cannot answer this. I suggest you download it and find out for yourself. It’s my understanding that it was going to be. So, I assume that it is. Perhaps someone else can chime in here.

Awesome