public ErrorCode SetLEDOutput(float percentOutput, LEDChannel ledChannel) { /* convert float to integral fixed pt */ if (percentOutput > 1) { percentOutput = 1; } if (percentOutput < 0) { percentOutput = 0; } int dutyCycle = (int)(percentOutput * 1023); // [0,1023] return(_ll.SetLEDOutput(dutyCycle, (uint)ledChannel)); }