0

我正在为 UWP 覆盆子开发应用程序,我需要通过串行端口读取硬币选择器的输入,我遵循示例https://github.com/ms-iot/samples/tree/develop/SerialSample/CS,但是我无法将其放入等待硬币选择器输入的计时器中

谢谢

4

1 回答 1

0
public MainPage()
{
    var timer = new DispatcherTimer();
    timer.Tick += DispatcherTimerEventHandler;
    timer.Interval = new TimeSpan(0, 0, 0, 1);
    timer.Start();
} 

private void DispatcherTimerEventHandler(object sender, object e)
{
    coin();            
}

private void coin()
{
    //Runs every second.
}
于 2016-02-25T12:04:06.677 回答