public void SetPwmParameters(int channel, Eth32PwmChannel state, double freq, double duty) { if (channel < 0 || channel > 1) { error = "Channel out of range"; } PwmChans[channel].state = state; PwmChans[channel].freq = freq; PwmChans[channel].duty = duty; BasicLog.writeLog(String.Format("SetPwmParameters(channel: {0}, freq: {1}, duty: {2})", channel, freq, duty)); }
public void GetPwmParameters(int channel, out Eth32PwmChannel state, out double freq, out double duty) { state = Eth32PwmChannel.Disabled; freq = 0.0; duty = 0.0; if (channel < 0 || channel > 1) { error = "Channel out of range"; } state = PwmChans[channel].state; freq = PwmChans[channel].freq; duty = PwmChans[channel].duty; }