私はWindows 10 IoTコアを実行しているRaspberry Pi 2でプロジェクトを行っています。ビデオを開いた状態でプロジェクト主題センサのトリガ。 しかし、私は次のエラーを取得しています:Windows 10 IoTコア - ビデオを開く閉じる
An exception of type 'System.Exception' occurred in ProjeVol1.exe but was not handled in user code
Additional information: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))
コード:
private void SensorPin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
{
Debug.WriteLine("Sensor Tetiklendi");
if (args.Edge == GpioPinEdge.FallingEdge)
{
Debug.WriteLine("Falling Edge");
ledPin.Write(GpioPinValue.High);
VideoAc();
}
else if (args.Edge == GpioPinEdge.RisingEdge)
{
Debug.WriteLine("Rising Edge");
ledPin.Write(GpioPinValue.High);
}
}
public void VideoAc()
{
video.AutoPlay = true;
video.Play();
video.MediaEnded += Video_MediaEnded;
}
おかげで、私はそれをしようとしています。 –