STM32F103C8T6 realize led water lamp

1. Hardware wiring:

 

 

 

 

 

 

 

 

 

 2 、 main.c

/ ************************************** 
 * File name: main.c
  * Description: Board The LED1 on the flashes.         
 * Experimental platform: MINI STM32 development board is based on STM32F103C8T6
  * Library version: ST3.0.0                                                                                                             

********************************* ************************ /     # include "stm32f10x.h" 
# include "led.h" 
void Delay ( __IO u32 nCount); 
int main ( void) 
{ 
 SystemInit ();     // Configure the system clock to 72M      
 LED_GPIO_Config (); // LED port initialization while (1 ) 
  {




        

  
        LED1( ON );              // 亮
        Delay(0x200000);
        LED1( OFF );          // 灭
        Delay(0x200000);

//        LED2( ON );
//        Delay(0x200000);
//        LED2( OFF );     
  }
}

void Delay(__IO u32 nCount)
{
  for(; nCount != 0; nCount--);
} 

3, led.c

 

Guess you like

Origin www.cnblogs.com/Mr-choa/p/12677886.html