This website works better with JavaScript.
Explore
Help
Sign In
danny
/
stm32-course
mirror of
https://gitee.com/gaohongy/stm32.git
Watch
1
Star
0
Fork
You've already forked stm32-course
0
Code
Issues
Packages
Projects
Releases
Wiki
Activity
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ac12d716c1
master
Branches
Tags
${ item.name }
Create tag
${ searchTerm }
Create branch
${ searchTerm }
from 'ac12d716c1'
${ noResults }
stm32-course
/
Examples
/
Timer_RotaryEncoder
/
Readme.md
380 B
Raw
Blame
History
Unescape
Escape
旋转编码器
初始化外部晶振
,
配置SYSCLK与Timer Clock均为72MHz
将PA8、PA9分别配置为TIM1_CH1、TIM1_CH2
配置TIM1
将Combined Channels配置为Encoder Mode
可以配置Input Filter
,
启用集成滤波器
,
减少抖动
,
范围0~15
配置USART2为Asynchronous
启动编码器
:
HAL_TIM_Encoder_Start(&htim1, TIM_CHANNEL_ALL)