third_party/phoenixsuite/cpp/src/CANifier.cpp
/**
 * Sets the PWM Output
 * Currently supports PWM 0, PWM 1, and PWM 2
 * @param pwmChannel  Index of the PWM channel to output.
 * @param dutyCycle   Duty Cycle (0 to 1) to output.  Default period of the signal is 4.2 ms.
 * @return Error Code generated by function. 0 indicates no error.
 */
Sets the PWM Output
Currently supports PWM 0, PWM 1, and PWM 2
@param pwmChannel  Index of the PWM channel to output.
@param dutyCycle   Duty Cycle (0 to 1) to output.  Default period of the signal is 4.2 ms.
@return Error Code generated by function. 0 indicates no error.
Sets the PWM Output Currently supports PWM 0 PWM 1 and PWM 2 @param pwmChannel Index of the PWM channel to output . @param dutyCycle Duty Cycle ( 0 to 1 ) to output . Default period of the signal is 4 . 2 ms . @return Error Code generated by function . 0 indicates no error .
ErrorCode CANifier::SetPWMOutput(int pwmChannel, double dutyCycle) {
	if (dutyCycle < 0) {
		dutyCycle = 0;
	} else if (dutyCycle > 1) {
		dutyCycle = 1;
	}
	if (pwmChannel < 0) {
		pwmChannel = 0;
	}
	int dutyCyc10bit = (int) (1023 * dutyCycle);
	return c_CANifier_SetPWMOutput(m_handle, (int) pwmChannel,
			dutyCyc10bit);
}
ErrorCode CANifier :: SetPWMOutput ( int pwmChannel , double dutyCycle ) { if ( dutyCycle < 0 ) { dutyCycle = 0 ; } else if ( dutyCycle > 1 ) { dutyCycle = 1 ; } if ( pwmChannel < 0 ) { pwmChannel = 0 ; } int dutyCyc10bit = ( int ) ( 1023 * dutyCycle ) ; return c_CANifier_SetPWMOutput ( m_handle , ( int ) pwmChannel , dutyCyc10bit ) ; }
Sets the PWM Output
 Currently supports PWM 0, PWM 1, and PWM 2
 @param pwmChannel  Index of the PWM channel to output.
Sets the PWM Output Currently supports PWM 0 PWM 1 and PWM 2 @param pwmChannel Index of the PWM channel to output .