先调试出 PWM(看调节占空比)这个容易 如果是飞思卡尔的 可以直接PE生成
/*
** ===================================================================
** Method : PWMPID_SetRatio16 (component PWM)
**
** Description :
** This method sets a new duty-cycle ratio.
** Parameters :
** NAME - DESCRIPTION
** Ratio - Ratio is expressed as an 16-bit unsigned integer
** number. 0 - 0xFFFF value is proportional
** to ratio 0 - 100%
** Note: Calculated duty depends on the timer possibilities
** and on the selected period.
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================