?? main_ex7.c
字號:
#include <REGX51.H>
unsigned int n;
void initTimer7(void) //timer init
{ TMOD=0x1;
TH0=0x15;
TL0=0xa0;
}
void timer07(void) interrupt 1 //timer0/counter0 interrupt
{ TH0=0x15;
TL0=0xa0;
if(n++>33) { P0= ~P0;
n=0; }
}
void ex7(void) //the main fun
{ initTimer7();
TR0=1; ET0=1; n=0; EA=1;
P2 |= 0x0f;//選通LED1~LED4工作
while(1);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -