lude "delay.h"
int main(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
GPIO_InitTypeDef GPIO_Initstructure;
GPIO_Initstructure.GPIO_Mode =GPIO_Mode_Out_PP ;
GPIO_Initstructure.GPIO_Pin =GPIO_Pin_All;
GPIO_Initstructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA,&GPIO_Initstructure);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
GPIO_InitTypeDef GPIO_RRR;
GPIO_RRR.GPIO_Mode =GPIO_Mode_Out_PP ;
GPIO_RRR.GPIO_Pin =GPIO_Pin_All;
GPIO_RRR.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB,&GPIO_RRR);
// GPIO_WriteBit(GPIOA,GPIO_Pin_0,Bit_RESET);
while(1)
{
GPIO_SetBits(GPIOB,GPIO_Pin_12);
GPIO_Write(GPIOA,~0x0001);
delay_tms(100);
GPIO_Write(GPIOA,~0x0002);
delay_tms(100);
GPIO_Write(GPIOA,~0x0004);
delay_tms(100);
GPIO_Write(GPIOA,~0x0008);
delay_tms(100);
GPIO_Write(GPIOA,~0x0010);
本章未完,请点击下一页继续阅读!