本文整理汇总了C#中Reader.GpoSet方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.GpoSet方法的具体用法?C# Reader.GpoSet怎么用?C# Reader.GpoSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reader
的用法示例。
在下文中一共展示了Reader.GpoSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetGPIOFunc
private static void SetGPIOFunc(Reader rdr, ArgParser pargs)
{
string[] args = pargs.commandArgs;
ArrayList pinvallist = (ArrayList)ParseValue(args[0]);
GpioPin[] gps = ArrayListToGpioPinArray(pinvallist);
rdr.GpoSet(gps);
}
示例2: TestSyncFunc
private static void TestSyncFunc(Reader rdr, ArgParser pargs)
{
// USB Reader, M5e Dev Kit: LED on = GPO false
bool on = false;
bool off = !on;
rdr.TagRead += delegate(Object sender, TagReadDataEventArgs e)
{
PrintTagRead(e.TagReadData);
rdr.GpoSet(new GpioPin[] {
new GpioPin(2, on),
});
Console.WriteLine("Wasting time:");
for (int i = 3; 0 < i; i--)
{
Console.Write(" {0:D}", i);
Thread.Sleep(300);
}
Console.WriteLine();
};
rdr.ReadException += delegate(Object sender, ReaderExceptionEventArgs e)
{
Console.WriteLine("Asynchronous Read Exception:");
Console.WriteLine(e.ReaderException.ToString());
};
rdr.GpoSet(new GpioPin[] {
new GpioPin(1, off),
new GpioPin(2, off),
});
rdr.StartReading();
DateTime startTime = DateTime.Now;
DateTime stopTime = startTime + new TimeSpan(0, 0, 5);
while (DateTime.Now < stopTime)
{
rdr.GpoSet(new GpioPin[] {
new GpioPin(1, off),
new GpioPin(2, off),
});
Thread.Sleep(10);
}
rdr.StopReading();
rdr.GpoSet(new GpioPin[] {
new GpioPin(1, on),
new GpioPin(2, on),
});
}