新手入门
积分 5
金钱 5
注册时间 2018-10-23
在线时间 1 小时
1 金钱
#include "sys.h"
#include "stm32f1xx_hal.h"
#include "pwm.h"
#include "gpio.h"
#include "delayus.h"
#include "direction.h"
#include "avoid.h"
#include "track.h"
#include "remote.h"
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; // ía2¿¾§Õñ£¬8MHz
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; // 9±¶Æ죬μÃμ½72MHzÖ÷ê±Öó
HAL_RCC_OscConfig(&RCC_OscInitStruct);
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; // Ïμí3ê±Öó£o72MHz
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // AHBê±Öó£o72MHz
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; // APB1ê±Öó£o36MHz
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; // APB2ê±Öó£o72MHz
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
// HAL_RCC_GetHCLKFreq()/1000 1msÖD¶Ïò»′Î
// HAL_RCC_GetHCLKFreq()/100000 10usÖD¶Ïò»′Î
// HAL_RCC_GetHCLKFreq()/1000000 1usÖD¶Ïò»′Î
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000); // ÅäÖÃ2¢Æô¶ˉÏμí3μÎ′e¶¨ê±Æ÷
/* Ïμí3μÎ′e¶¨ê±Æ÷ê±ÖóÔ′ */
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
/* Ïμí3μÎ′e¶¨ê±Æ÷ÖD¶ÏóÅÏ輶ÅäÖà */
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
/**
* oˉêy1|Äü: Ö÷oˉêy.
* êäèë2Îêy: ÎT
* ·μ »Ø Öμ: ÎT
* Ëμ Ã÷: ÎT
*/
int main(void)
{
Remote_Init(); //oìía½óêÕ3õê¼»ˉ
/* ¸′λËùóDíaé裬3õê¼»ˉFlash½ó¿úoíÏμí3μÎ′e¶¨ê±Æ÷ */
HAL_Init();
/* ÅäÖÃÏμí3ê±Öó */
SystemClock_Config();
/**************GPIO******************************************************************/
GPIOA_Init();//3õê¼»ˉL298N½ó¿ú
GPIOB_Init();//3õê¼»ˉÑ°¼£oíoìía±üÕÏÄ£¿é½ó¿ú
// GPIOC_Init()
/***************PWM******************************************************************/
/* í¨óö¨ê±Æ÷3õê¼»ˉ2¢ÅäÖà WMêä3ö1|Äü */
GENERAL_TIMx_Init();
/* Æô¶ˉí¨μàPWMêä3ö */
HAL_TIM_PWM_Start(&htimx,TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htimx,TIM_CHANNEL_2);
TIM3->CCR1=TIM3->CCR2=400;//μ÷3μËù£¬·¶Î§0~1000£¬êyÖμÔ½′óËù¶èÔ½¿ì
/* ÎTÏTÑ-»· */
while (1)
{
key=Remote_Scan();
if(key)
{
switch(key)
{
case 152:str="2";
{
forward();
}break;
case 48:str="4";
{
left();
}break;
case 122:str="6";
{
right();
}break;
case 56:str="8";
{
back();
}break;
default :break;
}
}else delay_ms(10);
//Track();//Ñ°¼£
}
}
这个就是那个错误,总是弄不好,感觉快做出来了,也不知道错在哪里请教各位大神//..\Inc\bsp\SYSTEM\sys\stm32f10x.h(8297): error: #5: cannot open source input file "stm32f10x_conf.h": No such file or directory
#include "stm32f10x_conf.h"
我来回答