LED显示摇棒制作

[09-13 21:14:57]   来源:http://www.88dzw.com  电子制作   阅读:8849

文章摘要:{0x7e,0xdd,0xfe}, {0xfe,0xbb,0x1e}, {0xff,0x77,0x65}, {0xff,0x6f,0xf9}, {0xff,0x9f,0xff}, {0xff,0xff,0xff}, {0xff,0xff,0xff}, {0xff,0xff,0xff}, }; uchar phase,th1,tl1,index,count; main() { EA=0; EX0=1; ET1=1; PX0=1; IT0=1; TMOD=0x11; index=0; EA=1; while(1) { } } void Int0_Handle(void) interrupt 0 u

LED显示摇棒制作,标签:电子制作网,http://www.88dzw.com
{0x7e,0xdd,0xfe},
{0xfe,0xbb,0x1e},
{0xff,0x77,0x65},
{0xff,0x6f,0xf9},
{0xff,0x9f,0xff},
{0xff,0xff,0xff},
{0xff,0xff,0xff},
{0xff,0xff,0xff},
};


uchar phase,th1,tl1,index,count;


main()
{
EA=0;
EX0=1;
ET1=1;
PX0=1;
IT0=1;
TMOD=0x11;
index=0;
EA=1;
while(1)
{
}
}

void Int0_Handle(void) interrupt 0 using 2
{
uint t0_time;
TR0=0;
TR1=0;
TF1=0;
t0_time=TH0<<8|TL0;
TL0=0;
TH0=0;
TR0=1;
t0_time=65535-t0_time/SEG;
th1=t0_time/256;
TH1=th1;
tl1=t0_time % 256;
TL1=tl1;
if (count<3*INTERVAL){ //3幅图片循环
count++;
}
else{
count=0;
}
index=count/INTERVAL;
if (th1!=0xff || tl1!=0xff){ //如果摆动特别慢,定时器溢出就不显示
phase=0;
TR1=1;
}
else{
TR1=0;
}
}

void Timer1(void) interrupt 3 using 3
{
if (phase<SEG) //17段依次显示
{
P1=pattern[phase][index];
phase++;
TH1=th1;
TL1=tl1;
}
}

上一页  [1] [2] 


Tag:电子制作电子制作网电子制作 - 电子制作

《LED显示摇棒制作》相关文章