【问题标题】:timer and serialdevice in uwp app for raspberry pi2用于覆盆子 pi2 的 uwp 应用程序中的计时器和串行设备
【发布时间】:2016-02-15 21:19:19
【问题描述】:

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

谢谢

【问题讨论】:

    标签: windows win-universal-app windowsiot


    【解决方案1】:
    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.
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-23
      • 2018-04-21
      • 1970-01-01
      相关资源
      最近更新 更多