金牌会员
 
- 积分
- 1463

- 威望
- 709
- 贡献
- 380
- 兑换币
- 409
- 注册时间
- 2013-11-8
- 在线时间
- 187 小时
|
- void main()
- {
- FTM_PWM_init(FTM0, FTM_CH2,20000, 100); //PTC3
- FTM_PWM_init(FTM0, FTM_CH3,20000, 100); //PTC4
- FTM_PWM_init(FTM0, FTM_CH4,20000, 100); //PTD4
- FTM_PWM_init(FTM0, FTM_CH6,20000, 100); //PTD6
- gpio_init (PTC3, GPO,0);
- gpio_init (PTC4, GPO,0);
- gpio_init (PTD4, GPO,0);
- gpio_init (PTD6, GPO,0);
- led_init (LED0);
- while(1)
- {
- led_turn (LED0);
- FTM_PWM_Duty(FTM0, FTM_CH2, 100);
- FTM_PWM_Duty(FTM0, FTM_CH3, 30);
- FTM_PWM_Duty(FTM0, FTM_CH4, 30);
- FTM_PWM_Duty(FTM0, FTM_CH6, 100);
- DELAY_MS(1000);
- FTM_PWM_Duty(FTM0, FTM_CH2, 30);
- FTM_PWM_Duty(FTM0, FTM_CH3, 100);
- FTM_PWM_Duty(FTM0, FTM_CH4, 100);
- FTM_PWM_Duty(FTM0, FTM_CH6, 30);
- DELAY_MS(1000);
- }
- }
复制代码
|
|