#define uchar unsigned char #define uint unsigned int sbit LED=P0; int i;
void DelayMS(uint x) {
uchar i; while(x--) { for(i=120;i>0;i--); } }
void main() {
LED=1; EA=1; EX0=1; EX1=1;
TCON=0x01; while(1); }
void External_Interrupt_0() interrupt 0 {
LED = ~LED; DelayMS(500); }
void External_Interrupt_1() interrupt 1 {
for(i=7;i>0;i--); { P0=_crol_(P0,1); DelayMS (500); }
for(i=7;i>0;i--); { P0=_crol_(P0,2); DelayMS(500); } }
因篇幅问题不能全部显示,请点此查看更多更全内容