Closed RaulTrombin closed 1 year ago
With this PR, navigator Cpp and Python can set up PWM with dynamic arrays lenghts, as follows.
Cpp:
init(); set_pwm_freq_hz(1000); PwmChannel channels[4] = { PwmChannel::Ch16, PwmChannel::Ch2, PwmChannel::Ch3, PwmChannel::Ch4, }; uint16_t values[4] = { 500, 1000, 1500, 2000 }; set_pwm_channel_value(PwmChannel::All, 0); // OR set_pwm_channels_value( channels, 1000, 4); // OR set_pwm_channels_values(channels, values, 4); pwm_enable(true);
Python:
navigator.init() navigator.set_pwm_freq_hz(1000) navigator.set_pwm_channel_value(PwmChannel.Ch1, 2000) # OR navigator.set_pwm_channels_value([PwmChannel.Ch1, PwmChannel.Ch16], 1000) # OR navigator.set_pwm_channels_values([PwmChannel.Ch1, PwmChannel.Ch5], [1000, 500]) navigator.pwm_enable(True)
Tested on current BlueOS, navigator hardware and osciloscope.
With this PR, navigator Cpp and Python can set up PWM with dynamic arrays lenghts, as follows.
Cpp:
Python:
Tested on current BlueOS, navigator hardware and osciloscope.