Skip to content

Commit

Permalink
blink LED
Browse files Browse the repository at this point in the history
  • Loading branch information
OhMeuMenino authored May 18, 2017
1 parent b8cdc9a commit 7274274
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions StartProject/src/main.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
/*
** Start project. It includes all Standart Peripherals Library
**
** Main.c
**
** This projects configure the GPIO G13 to blink the LED3 (green)
**
**********************************************************************/
/*
Last committed: $Revision: 00 $
Last changed by: $Author: $
Last changed date: $Date: $
ID: $Id: $
Last changed by: OhMeuMenino
Last changed date: May 2017
**********************************************************************/
#include "stm32f4xx_conf.h"

int main(void)
{
while(1)
{

}
/* GPIOG Peripheral clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);

/* Configure the PIN13 on PORTG */
GPIO_InitTypeDef PORTG;
PORTG.GPIO_Pin = GPIO_Pin_13; // Pin 13
PORTG.GPIO_Mode = GPIO_Mode_OUT; // Output
PORTG.GPIO_OType = GPIO_OType_PP; // Output Type - Push-pull mode
PORTG.GPIO_Speed = GPIO_Speed_100MHz;
PORTG.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOG, &PORTG);

int i=1000000;
while(1)
{
GPIO_ToggleBits(GPIOG,13);
for(i=1000000;i>0;i--);
}

}

0 comments on commit 7274274

Please sign in to comment.