I am trying to setup a PWM to generate constant pulse for my monitoring project.
Below are the codes.
Public WithEvents Supply As InterruptPort Public PWM_Supply As New SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5) Supply = New InterruptPort(Pins.GPIO_PIN_D0, False, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeHigh) Dim period As UInt32 = 1 * 1000 * 1000 '1 seconds Dim duration As UInt32 = 5 * 100 * 1000 '0.5 seconds PWM_Supply.SetPulse(period, duration)
After executing the last command "SetPulse", the below exception will be trigger
A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.PWM.dll
Can anyone highlight the problem in this declaration?
Thanks in advance.
Regards,
Novice Alex