#include "stm32f10x.h" #define PIN GPIO_Pin_0 #define PORT GPIOB void delay() { int i; for (i = 0; i < 10000; i++); } int main() { GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = PIN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(PORT, &GPIO_InitStructure); while (1) { GPIO_SetBits(PORT, PIN); delay(); GPIO_ResetBits(PORT, PIN); delay(); } return 0; }