我正在开发一个UWP覆盆子的应用程序,我需要通过串口读取硬币选择器的输入,我按照示例https://github.com/ms-iot/samples/tree/develop/SerialSample / CS,但我无法将其放入计时器中等待来自硬币选择器的输入
由于
答案 0 :(得分: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.
}