新聞中心

EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > XS128單片機(jī)實(shí)驗(yàn):B口燈交替閃亮

XS128單片機(jī)實(shí)驗(yàn):B口燈交替閃亮

作者: 時(shí)間:2016-12-01 來(lái)源:網(wǎng)絡(luò) 收藏
#include /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#include "WQ.h"
//This is the firstprogramof mine,its used to text the board;
//LED will twinkle in very fast speed;
void DELAY(int y)
{
int i,x;
for (i=y;i>0;i--)
for(x=220;x>0;x--);
}
void main(void) {
DDRB =0XFF; //置1,作為輸出口
while(1){
PORTB=0x55;
DELAY(550);
PORTB=0XAA;
DELAY(550);
}

}


評(píng)論


技術(shù)專(zhuān)區(qū)

關(guān)閉