Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement