Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
public enum InterruptMode
{
InterruptNone, // The port is deactivated
InterruptEdgeLow, // falling edge (Change from high to low)
InterruptEdgeHigh, // rising edge (Change from low to high)
InterruptEdgeBoth, // both edges (Any state change)
InterruptEdgeLevelHigh, // high
InterruptEdgeLevelLow // low
}
public static void Main()
{
InterruptPort port = new InterruptPort(Cpu.Pin.GPIO_Pin3,false,Port.ResistorMode.PullDown,
Port.InterruptMode.InterruptEdgeBoth);
port.OnInterrupt += new NativeEventHandler(port_OnInterrupt);
Thread.Sleep(Timeout.Infinite);
}
private static void port_OnInterrupt(uint port,uint state,TimeSpan time)
{
Debug.Print("Pin=" + port + " State=" + state + " Time=" + time);
}
Знакомство с .Net Micro Framework