Хабр Курсы для всех
РЕКЛАМА
Большая витрина: от крупнейших школ до частных авторов. Сравнивайте по цене, длительности, формату и выбирайте самый подходящий курс!
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