Example #1
0
        public ErrorCode SetPWMOutput(uint pwmChannel, float dutyCycle)
        {
            if (dutyCycle < 0)
            {
                dutyCycle = 0;
            }
            else if (dutyCycle > 1)
            {
                dutyCycle = 1;
            }

            int dutyCyc10bit = (int)(1023 * dutyCycle);

            return((ErrorCode)_ll.SetPWMOutput((uint)pwmChannel, dutyCyc10bit));
        }