I am currently realizing a project in C # on a Raspberry Pi 3. On the Pi, Windows runs IoT Core in the latest stable release release (v.10.0.16299.309). When I initiate the PWM pins, the method runs in an exception (System.Runtime.InteropServices.SEHException: 'External component raised an exception.'). All rights are set and all releases are set on the Windows Fall Creators Update. Can someone be with me. Thank you.
here the Code:
private async void StartPWM()
{
GpioController gpioController = await GpioController.GetDefaultAsync();
if (LightningProvider.IsLightningEnabled)
{
try
{
LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
var pwmControllers = await PwmController.GetControllersAsync(LightningPwmProvider.GetPwmProvider());
var pwmController = pwmControllers[1];
pwmController.SetDesiredFrequency(50); //<---- Here it crasches
dictionaryPwm = new Dictionary<int, PwmPin>
{
{23,PWM.ActivatePwmPin(23,pwmController) },
{24,PWM.ActivatePwmPin(24,pwmController) }
};
}
catch(Exception exception)
{
throw exception;
}
}
}