Table of Contents
quanser.hardware.hil.set_pwm_frequency
Sets the frequencies of the specified PWM channels.
err = board.set_pwm_frequency(channels, frequencies)
Sets the frequencies of the specified PWM channels. This function is typically used only in
PWM_DUTY_CYCLE_MODE
(the default). Refer to the
set_pwm_mode function for details on PWM modes.
If no err output is provided then it throws an exception if an error occurs. In generated code it prints the error message. Use hil_get_error_message to get the message associated with an error code.
board
The board instance returned by the quanser.hardware.hil.open function.
channels
A vector of channel numbers. Channel numbers are zero-based.
Select a board type from the list for board-specific details: .
frequencies
A vector of frequencies in Hertz. There must be one element for each channel in the channels vector.
err
A negative error code or zero on success.
% Sets PWM channel 0 to 10 kHz and channel 1 to 20 kHz.
board.set_pwm_frequency([0 1], [10000 20000]);
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.