Initializes PWM module
mdaqPWMInit(module, period, activeLow, dutyChannelA, dutyChannelB)
This function initializes MicroDAQ PWM module. Each PWM module has A and B channel which can generate PWM waveform with different duty and same period defined for PWM module. PWM waveform period is defined in microseconds (us). Active LOW option allows generation of inverted PWM waveform. Channel A and B inputs determines initial PWM duty (0-100).
module: PWM module (1|2|3)
period: PWM module period in microseconds (2-500000)
activeLow: Generate inverted PWM waveform (true/false to enable or disable)
dutyChannelA: initial PWM channel A duty
dutyChannelB: initial PWM channel B duty
% setup PWM1 to 1khz period and initial duty for A and B channel to 0 mdaqPWMInit(1, 1000, false, 0, 0) % set PWM1 duty channel A to 25% ane channel B to 50% mdaqPWMWrite(1, 25, 50)