Is there a standard way of upgrading the PWM.SetPulse method from .NETMF4.1 to the newer "channel-based" PWM in .NETMF 4.2? I'm trying to port the following code:
public Tlc5940New(PWM gsclk, PWM blank, OutputPort xlat, OutputPort sin, OutputPort sclk) { GSCLKPin = gsclk; BLANKPin = blank; XLATpin = xlat; SINPin = sin; SCLKPin = sclk; // Clear the channels, and disable the output GSCLKPin.DutyCycle = 0; BLANKPin.DutyCycle = 0; XLATpin.Write(false); SINPin.Write(false); SCLKPin.Write(false); GSCLKPin.SetPulse(gsclk_period, 1); BLANKPin.SetPulse((gsclk_period * 4096), 1); }
The error is happening on the lines GSCLKPin.SetPulse(gsclk_period, 1); and BLANKPin.SetPulse((gsclk_period * 4096), 1); because SetPulse is not supported by the new 4.2 libraries so I have to come up with equivalent code. I took this code from somewhere else so I do not know how exactly I should use the 4.2 PWM in place of this 4.1 code.
Any help is greatly appreciated.