#include<intrins.h>
#define uchar unsigned char
uchar cnt,times
void delay()
{
uchar i
TMOD=0x01
TH0=(65536-50000)/256
TL0=(65536-50000)%256
TR0=1
for(i=0i<timesi++)
{
while(TF0==0)
TH0=(65536-50000)/256
TL0=(65536-50000)%256
TF0=0
}
TR0=0
}
void ext0() interrupt 0
{
uchar i,j
P1=0xfe
times=8
for(i=0i<5i++)
{
for(j=0j<8j++)
{
P1=_crol_(P1,1)
delay()
}
}
}
void ext1() interrupt 2
{
uchar i,j
P1=0x7f
times=12
for(i=0i<3i++)
{
for(j=0j<8j++)
{
P1=_cror_(P1,1)
delay()
}
}
}
main()
{
EX0=1
EX1=1
IT0=0
IT1=1
PX0=0
PX1=1
while(1)
}
include<reg51.h>include<intrins.h>define uchar unsigned charuchar cnt,timesvoid delay(){uchar iTMOD=0x01TH0=(65536-50000)/256TL0=(65536-50000)%256TR0=1for(i=0i<timesi++){while(TF0==0)TH0=(65536-50000)/256TL0=(65536-50000)%256TF0=0}TR0=0}void ext0() interrupt 0{uchar i,jP1=0xfetimes=8for(i=0i<5i++){for(j=0j<8j++){P1=_crol_(P1,1)delay()}}}void ext1() interrupt 2{uchar i,jP1=0x7ftimes=12for(i=0i<3i++){for(j=0j<8j++){P1=_cror_(P1,1)delay()}}}main(){EX0=1EX1=1IT0=0IT1=1PX0=0PX1=1while(1)}欢迎分享,转载请注明来源:内存溢出
评论列表(0条)