<< mdaqLEDWrite Data acquisition mdaqPWMWrite >>

MicroDAQ Support Package for Matlab/Simulink >> MicroDAQ Support Package for Matlab/Simulink > Data acquisition > mdaqPWMInit


Initializes PWM module

Calling Sequence

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).



% 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)

See Also

Report an issue
<< mdaqLEDWrite Data acquisition mdaqPWMWrite >>