本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
#include <reg52.h>
typedef unsigned char uint8;
sbit ENLED = P2^4;
sbit ADDR3 = P2^3;
sbit ADDR2 = P2^2;
sbit ADDR1 = P2^1;
sbit ADDR0 = P2^0;
sbit DB0 = P1^0;
void main()
{
unsigned char i,k,p,t,j;
char l;
unsigned char a[]={0,1,2,4,6,16,32,64};
unsigned char b[]={0,34,48,59,68,76,84,91,97,103,109,114,119,123,126};
signed char c[]={-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
ENLED=0;ADDR3=1;
ADDR0=0;ADDR1=1;ADDR2=1;
P1=0xFF;
while(1)
{
k=0;
for(i=0;i<=252;i++)
{
if(0==(i%4)) k++;
for(t=0;t<=16;t++)
{
DB0=0;
for(j=0;j<=64;j++)
if(j==k) DB0=1;
}
}
for(j=0;j<=254;j++)
{
p=0;
for(k=0;k<=15;k++)
{if(j==b[k]) l=c[k];}
for(i=0;i<=64;i++)
{
for(k=0;k<=7;k++)
{
if(i==a[k])
{
p=p|(1<<k);
t=~p;
if(l>=0)
P1=~(t<<l);
else
P1=~(t>>-l);
}
}
}
}
}
} |