標(biāo)題:
stm32開發(fā)板—雙LED交替閃爍1S(初學(xué)者福利)
[打印本頁]
作者:
492126190
時(shí)間:
2018-5-10 10:31
標(biāo)題:
stm32開發(fā)板—雙LED交替閃爍1S(初學(xué)者福利)
單片機(jī)源程序如下:
//-----------------------------------------------------------------
// 程序描述:
// 手動(dòng)延時(shí)實(shí)現(xiàn)延時(shí)功能測試程序
// 測試功能: 實(shí)現(xiàn)雙LED交替閃爍1S
//
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// 頭文件包含
//-----------------------------------------------------------------
#include <stm32f10x.h>
#include "Delay.h"
#include "LED.h"
#include "PeripheralInit.h"
//-----------------------------------------------------------------
// 主程序
//-----------------------------------------------------------------
int main(void)
{
PeripheralInit(); // 外設(shè)初始化
LED1_ON; // 預(yù)設(shè)LED狀態(tài)
LED2_OFF;
while (1) // 雙LED交替閃爍
{
LED1_Toggle;
LED2_Toggle;
Delay_50ms(10);
}
}
//-----------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------
復(fù)制代碼
所有資料51hei提供下載:
led.rar
(101.21 KB, 下載次數(shù): 17)
2018-5-13 04:09 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
作者:
492126190
時(shí)間:
2018-5-10 10:33
基于STM32F103VC開發(fā)板,實(shí)現(xiàn)雙LED交替閃爍1s
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1