91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 880KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-05
  • 語言: 其他
  • 標簽:

資源簡介

stm32 超聲波避障小車1stm32 超聲波避障小車1stm32 超聲波避障小車1

資源截圖

代碼片段和文件信息

/*****************************************************************************

項目:超聲波避障小車
功能:遇到障礙物避開
實現(xiàn)過程:小車行走過程--遇到障礙物--避開

*****************************************************************************/
#include?“stm32f10x.h“//?Device?header

double?TIMCoutertime;
u8?succeed_flag?=?0;
int?distance;

/****************************************************************************

設置配置GPIOA引腳
PA0~PA3、PA5配置成推挽輸出
PA6配置成上拉輸入
PA7配置成復用功能推挽輸出

輸出速度都為50MHz

****************************************************************************/




/****************************************************************************

舵機模塊
利用PWM來控制舵機方向

****************************************************************************/
void?PWM_Configuration()
{
GPIO_InitTypeDef?GPIO_InitStructure;
TIM_TimebaseInitTypeDef?TIM_TimebaseStructure;
TIM_OCInitTypeDef?TIM_OCInitStructure;

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOAENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIOENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3ENABLE);

GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_50MHz;
GPIO_Init(GPIOA&GPIO_InitStructure);

TIM_TimebaseStructure.TIM_Period?=?20000-1;
TIM_TimebaseStructure.TIM_Prescaler?=?72-1;
TIM_TimebaseStructure.TIM_ClockDivision?=?TIM_CKD_DIV1;;
TIM_TimebaseStructure.TIM_CounterMode?=?TIM_CounterMode_Up;
TIM_TimebaseStructure.TIM_RepetitionCounter?=?0;
TIM_TimebaseInit(TIM3&TIM_TimebaseStructure);

TIM_ARRPreloadConfig(TIM3DISABLE);

TIM_OCInitStructure.TIM_OCMode?=?TIM_OCMode_PWM2;
TIM_OCInitStructure.TIM_Pulse?=?0;
TIM_OCInitStructure.TIM_OutputState?=?TIM_OutputState_Enable;
TIM_OCInitStructure.TIM_OCPolarity?=?TIM_OCPolarity_Low;
TIM_OC2Init(TIM3&TIM_OCInitStructure);
TIM_OC2PreloadConfig(TIM3TIM_OCPreload_Enable);

TIM_CtrlPWMOutputs(TIM3ENABLE);
TIM_ARRPreloadConfig(TIM3ENABLE);
TIM_Cmd(TIM3DISABLE);
}

/*****************************************************************************

配置電機

*****************************************************************************/

void?EXTI_Configuration()
{
GPIO_InitTypeDef?GPIO_InitStructure;

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOAENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIOENABLE);

GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_50MHz;
GPIO_Init(GPIOA&GPIO_InitStructure);



GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IPD;
GPIO_Init(GPIOA&GPIO_InitStructure);

EXTI_InitTypeDef?EXTI_InitStructure;
EXTI_ClearITPendingBit(EXTI_Line6);
GPIO_EXTILineConfig(GPIO_PortSourceGPIOAGPIO_PinSource6);
EXTI_InitStructure.EXTI_Line?=?EXTI_Line6;
EXTI_InitStructure.EXTI_Mode?=?EXTI_Mode_Interrupt;
E

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????6956??2015-12-10?17:06??超聲波避障\DebugConfig\Target_1_STM32F103RC_1.0.0.dbgconf

?????文件????????339??2017-10-05?21:45??超聲波避障\EventRecorderStub.scvd

?????文件??????54948??2017-10-05?21:40??超聲波避障\Listings\startup_stm32f10x_hd.lst

?????文件??????87440??2017-10-05?21:40??超聲波避障\Listings\test.map

?????文件?????????19??2017-10-05?21:46??超聲波避障\objects\ExtDll.iex

?????文件?????281699??2017-10-05?21:40??超聲波避障\objects\misc.crf

?????文件???????1437??2017-10-05?21:40??超聲波避障\objects\misc.d

?????文件?????305832??2017-10-05?21:40??超聲波避障\objects\misc.o

?????文件?????????81??2017-10-05?21:40??超聲波避障\objects\startup_stm32f10x_hd.d

?????文件???????6836??2017-10-05?21:40??超聲波避障\objects\startup_stm32f10x_hd.o

?????文件?????282247??2017-10-05?21:40??超聲波避障\objects\stm32f10x_exti.crf

?????文件???????1617??2017-10-05?21:40??超聲波避障\objects\stm32f10x_exti.d

?????文件?????310288??2017-10-05?21:40??超聲波避障\objects\stm32f10x_exti.o

?????文件?????285192??2017-10-05?21:40??超聲波避障\objects\stm32f10x_gpio.crf

?????文件???????1617??2017-10-05?21:40??超聲波避障\objects\stm32f10x_gpio.d

?????文件?????327216??2017-10-05?21:40??超聲波避障\objects\stm32f10x_gpio.o

?????文件?????288768??2017-10-05?21:40??超聲波避障\objects\stm32f10x_rcc.crf

?????文件???????1599??2017-10-05?21:40??超聲波避障\objects\stm32f10x_rcc.d

?????文件?????347972??2017-10-05?21:40??超聲波避障\objects\stm32f10x_rcc.o

?????文件?????303775??2017-10-05?21:40??超聲波避障\objects\stm32f10x_tim.crf

?????文件???????1599??2017-10-05?21:40??超聲波避障\objects\stm32f10x_tim.d

?????文件?????438368??2017-10-05?21:40??超聲波避障\objects\stm32f10x_tim.o

?????文件?????282780??2017-10-05?21:40??超聲波避障\objects\system_stm32f10x.crf

?????文件???????1480??2017-10-05?21:40??超聲波避障\objects\system_stm32f10x.d

?????文件?????304540??2017-10-05?21:40??超聲波避障\objects\system_stm32f10x.o

?????文件?????288624??2017-10-05?21:40??超聲波避障\objects\test.axf

?????文件???????4011??2017-10-05?21:40??超聲波避障\objects\test.build_log.htm

?????文件?????282943??2017-10-05?21:40??超聲波避障\objects\test.crf

?????文件???????1265??2017-10-05?21:40??超聲波避障\objects\test.d

?????文件??????51186??2017-10-05?21:40??超聲波避障\objects\test.htm

............此處省略24個文件信息

評論

共有 條評論