标题:
STM32增量式编码器例程
[打印本页]
作者:
liyan1111
时间:
2018-6-22 16:59
标题:
STM32增量式编码器例程
基于STM32增量式编码器程序
单片机源程序如下:
/**
******************************************************************************
* @file main.c
* @author hb.wang
* @version V1.0
* @date 2015-02-xx
* @brief 用3.5.0版本库建的工程模板
*/
#include <stm32f10x.h>
#include <string.h>
#include "my_usart.h"
#include "pc_cmd.h"
#include "enc.h"
#include "timer.h"
#include "iwdg.h"
extern pc_cmd_t pc_cmd;
__IO u8 XXX[4] ;
/**
* @brief 主函数
* @param 无
* @retval 无
*/
int main(void)
{
// RCC_ClocksTypeDef RCC_CLKS_Structure;
// RCC_GetClocksFreq(RCC_ClocksTypeDef* );
// USART1_Config(19200);
// USART2_Config(19200);
// USART3_Config(19200);
// IWDG_Init(4,625); //与分频数为64,重载值为625,溢出时间为1s
ENCODER_GPIO_Config();/** encoder GPIO_Config ???GPIO?? **/
TIM3_Init(); //0.1Sec ??????????????
Encoder_Init();
while(1)
{
IWDG_Feed();
Get_Encoder_Distance();
/* add your code here ^_^. */
}
}
/*********************************************END OF FILE**********************/
复制代码
所有资料51hei提供下载:
STM32增量式编码器.rar
(338.82 KB, 下载次数: 55)
2018-6-22 17:00 上传
点击文件名下载附件
下载积分: 黑币 -5
作者:
wangcongliang
时间:
2019-1-17 20:33
请问有具体的程序思路和仿真提供吗?感觉光看程序有点难以消化啊,
谢谢!
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1