This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PWMPulseWidthSet不能改变脉宽值吗



PWMPulseWidthSet(PWM1_BASE, PWM_OUT_0, Power_Full);

 PWMPulseWidthSet(PWM1_BASE, PWM_OUT_1, Power_Full);

 PWMPulseWidthSet(PWM1_BASE, PWM_OUT_6, Power_Full);

  PWMPulseWidthSet(PWM1_BASE, PWM_OUT_7, Power_Full);

这个函数单独调用不能改变脉宽吗

要怎样才能改变呢

  • 参考如下代码:

    //
    // Set PWM0 PD0 to a duty cycle of 25%. You set the duty cycle as a
    // function of the period. Since the period was set above, you can use the
    // PWMGenPeriodGet() function. For this example the PWM will be high for
    // 25% of the time or 16000 clock cycles (64000 / 4).
    //
    PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0, PWMGenPeriodGet(PWM0_BASE, PWM_OUT_0) / 4);