【发布时间】:2018-08-21 06:32:30
【问题描述】:
我是 Windows 10 IoT 的新手。
我将使用 DragonBoard 410c 将应用程序作为白板应用程序。
我将按钮连接到 GPIO。
并编码如下,但发生错误。
private void InitGPIO()
{
var gpio = GpioController.GetDefault();
if(gpio == null)
{
var dialog2 = new MessageDialog("Please Check GPIO");
dialog2.ShowAsync();
return;
}
BTN_UP = gpio.OpenPin(BTN_UP_NUMBER);
BTN_UP.SetDriveMode(GpioPinDriveMode.Input);
BTN_UP.DebounceTimeout = TimeSpan.FromMilliseconds(50);
BTN_UP.ValueChanged += btn_up_pushed;
var dialog = new MessageDialog("GPIO Ready");
dialog.ShowAsync();
}
private void btn_up_pushed(GpioPin sender, GpioPinValueChangedEventArgs e)
{
int but_width = 0;
int but_height = 0;
but_width = (int)cutButton.Width;
but_height = (int)cutButton.Height;
}
当我按下按钮时,调用 btn_up_pushed()。 但发生如下图错误。
请帮帮我!
【问题讨论】:
标签: uwp gpio windows-iot-core-10 dragonboard