仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
单片机源程序如下:
#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char;
#define uint unsigned int;
uchar code M[]={0xff,0xff,0xfe,0xfd,0xf8,0xfd,0xfe,0xff,
0xff,0xff,0xfd,0xfb,0xf0,0xfb,0xfd,0xff,
0xff,0xff,0xfb,0xf7,0xe0,0xf7,0xfb,0xff,
0xff,0xff,0xf7,0xef,0xc0,0xef,0xf7,0xff,
0xff,0xff,0xef,0xdf,0x80,0xdf,0xef,0xff,
0xff,0xff,0xdf,0xbf,0x00,0xbf,0xdf,0xff};
uchar i,num,t;
int main(){
TMOD=0x01;
TH0=(65536-2000)/256;
TL0=(65536-2000)%256;
TR0=1;
EA=1;
ET0=1;
P3=0x80;
while(1);
return 0;
}
完整代码及仿真见附件
点阵箭头.rar
(15.69 KB, 下载次数: 62)
|