You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
#include "motor.h" |
|
|
#include "timer.h" |
|
|
#include "delay.h" |
|
|
|
|
|
u16 Ypwmva=0; |
|
|
u16 Zpwmva=0; |
|
|
|
|
|
|
|
|
void motor_Init(void) |
|
|
{ |
|
|
GPIO_InitTypeDef GPIO_InitStructure; |
|
|
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); |
|
|
|
|
|
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_14; //PB5<EFBFBD><EFBFBD>PB0 <EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |
|
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |
|
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IO<EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>Ϊ50MHz |
|
|
GPIO_Init(GPIOC, &GPIO_InitStructure); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>趨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD> |
|
|
GPIO_SetBits(GPIOC,GPIO_Pin_13|GPIO_Pin_14); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|