找回密码
 注册会员
搜索附件  

loader.swf

 

自制摇摇棒:





实物制作可以看看我空间的照片


程序如下

#include<reg52.h>
unsigned char k,n,t;
unsigned long code ziku[]=
{0xDF,0xFF,0xAF,0xEF,0xB7,0xED,0xB0,0xED,0xB7,0xED,0x97,0xED,0xA7,0xED,0x37,0xC0,
0xFF,0xFF,0x01,0x00,0xFD,0xF7,0xBD,0xEF,0x4D,0xDF,0xF1,0xEE,0xFF,0xF1,0xFF,0xFF,

0xFF,0xBF,0x01,0x81,0xBD,0xBF,0x3D,0xC0,0xBD,0xDD,0x80,0xDD,0xED,0xFE,0xF7,0x00,
0x73,0xBD,0xA8,0xBD,0xDB,0xBD,0xAB,0xBD,0x73,0xBD,0x7B,0x00,0x7F,0xFD,0xFF,0xFF,

0xFF,0xBF,0x01,0x81,0xBD,0xBF,0x3D,0xC0,0xBD,0xDD,0x80,0xDD,0xED,0xFE,0xF7,0x00,
0x73,0xBD,0xA8,0xBD,0xDB,0xBD,0xAB,0xBD,0x73,0xBD,0x7B,0x00,0x7F,0xFD,0xFF,0xFF};



void delay(unsigned char t)
{ unsigned char a,b;
for(a=t;a>0;a--)
for(b=110;b>0;b--);
}




void main()
{
TMOD=0X01;
TH0=0XFC;
TL0=0X18;
EA=1;
ET0=1;
TR0=1;

}

void timer0() interrupt 1
{
TH0=0XFC;
TL0=0X18;
t++;
if(t==20)
{
t=0;
n+=2;
if(n==96)
{ n=0;
P2=ziku[n];
P3=ziku[n+1];
delay(2);

}
}
}











//P2=ziku[n];
// P3=ziku[n+1];
这两句就可以看出发光二极管怎么接的了,共阳,电路在脑子里就出来了,懒得画了!感谢大家的支持!!!
[ 此贴被zlulu2006在2009-06-20 11:22重新编辑 ]

QQ|手机版|MCU资讯论坛 ( 京ICP备18035221号-2 )|网站地图

GMT+8, 2024-12-24 02:04 , Processed in 0.039263 second(s), 8 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

返回顶部