Ahmet
S38>S85
- Katılım
- 31 Mayıs 2021
- Mesajlar
- 6,167
		Kod:
	
	        //RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
    //RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
    
    GPIO_InitTypeDef GPIO_InitStructure;
    
    GPIO_InitStructure.GPIO_Pin = LEDs;
    GPIO_InitStructure.GPIO_Mode     = GPIO_Mode_OUT;
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_PuPd     = GPIO_PuPd_NOPULL;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
    GPIO_Init(LED_PORT, &GPIO_InitStructure);
    
    
    GPIO_InitStructure.GPIO_Pin     = bt;
    GPIO_InitStructure.GPIO_Mode     = GPIO_Mode_IN;
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_PuPd     = GPIO_PuPd_UP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
    GPIO_Init(bt_port, &GPIO_InitStructure);Birde bana sor abi.
sadece 1 giriş 1 çıkış tanımladım

Ama böyle yazmak daha güzel geliyor. normalde bunu arduino ile kıyaslarsam pinMode(pin,mod); ile aynı işi yapıyor bu 2 ayı blok
 
	 
 
		 
 
		

 
 
		 
 
		 
 
		