1.1 介绍:
LED模块。它的控制方法非常简单,要想点亮LED,只要让它两端有一定的电压就可以;实验中,我们通过编程控制信号端S的高低电平,从而控制LED的亮灭。我们提供一个测试代码控制LED模块上实现闪烁的效果。
1.2 模块相关资料

1.3 实验组件:

1.4模块接线图:

1.5 实验代码:
https://sourl.cn/7FXAif
int main(void)
{
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
	
	GPIO_InitTypeDef GPIO_InitStructure;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(GPIOA, &GPIO_InitStructure);         //初始化GPIO_A0为输出模式
	
	while (1)
	{	
		GPIO_WriteBit(GPIOA, GPIO_Pin_0, Bit_RESET);  //A0输出低
		Delay_ms(500);
		GPIO_WriteBit(GPIOA, GPIO_Pin_0, Bit_SET);    //A0输出高
		Delay_ms(500);
		
	}
}
1.6实验结果:
将示例代码上传到主板,上传成功后,同时蓝色LED亮500毫秒,灭500毫秒,循环交替。
1.7 代码说明:
GPIO_Init() GPIO初始化函数
 GPIO_WriteBit() 设置引脚输出电平
 delay(500); 延时500毫秒



![[Vue warn]: Duplicate keys detected: ‘xxx‘. This may cause an update error.](https://i-blog.csdnimg.cn/direct/04c377479d67440f98e4538bbd99bc15.png)














