3783| 3
|
STM8S 输出比较 |
1金钱
最佳答案void TIM1_PWM_Init()
{
TIM1_DeInit(); //去初始化
GPIO_Init(GPIOC,GPIO_PIN_1,GPIO_MODE_OUT_PP_HIGH_FAST); //灯的哪个引脚
TIM1_TimeBaseInit(16,TIM1_COUNTERMODE_UP,999,0x00); //设置分频,模式,预装载值等
TIM1_OC1Init(TIM1_OCMODE_PWM2,TIM1_OUTPUTSTATE_ENABLE,TIM1_OUTPUTNSTATE_ENABLE
,499,TIM1_OCPOLARITY_HIGH,TIM1_OCNPOLARITY_HIGH,TIM1_OCIDLESTATE_RESET,
TIM1_OCNIDLESTATE_RESET); / ...
| ||
| ||
发表于 2017-5-30 18:47:26
|
显示全部楼层
| ||
| ||
|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )
GMT+8, 2024-11-23 00:03
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网