Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure;
- // Wlaczenie sygnalu taktujacego port D
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD , ENABLE);
- GPIO_InitStructure.GPIO_Pin = (GPIO_Pin_12 | GPIO_Pin_14);
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- GPIO_Init(GPIOD, &GPIO_InitStructure);
- // Wyzerowanie wyjscia PD14
- GPIO_ResetBits(GPIOD, GPIO_Pin_14);
- // Ustawienie wyjscia PD12
- GPIO_SetBits(GPIOD, GPIO_Pin_12);
- while(1){
- // Zmiana stanu wyjsc na przeciwny
- GPIO_ToggleBits(GPIOD, GPIO_Pin_12 | GPIO_Pin_14);
- // Czekaj
- Delay();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement