/*******************************************************************************
*标题: 实验翻页显示(0~5不用定时器) *
*作者:龙的传人 *
*公司:普中科技 *
*论坛:www.prechin.net *
********************************************************************************
*描述:通过本例程能使读者更好了解点阵的扫描原理 *
*连接:JP11和J20,JP10和J12用8排线相连 *
* *
* 希望学员认真消化本例程 *
*******************************************************************************/
#include<reg51.h>
unsigned int timecount;
unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code shuzu[]={
0x00,0x00,0x3e,0x41,0x41,0x41,0x3e,0x00, //0
0x00,0x00,0x00,0x00,0x21,0x7f,0x01,0x00, //1
0x00,0x00,0x27,0x45,0x45,0x45,0x39,0x00, //2
0x00,0x00,0x22,0x49,0x49,0x49,0x36,0x00, //3
0x00,0x00,0x0c,0x14,0x24,0x7f,0x04,0x00, //4
0x00,0x00,0x72,0x51,0x51,0x51,0x4e,0x00, //5
};
void delay(unsigned int t)
{
while (t--)
{;}
}
void main(void)
{ unsigned char i,j,a;
while(1)
{
for(i=0;i<=5;i++)
for(a=0;a<=80;a++) //移动速度
{
for(j=0;j<=7;j++)
{
P0=shuzu[8*i+j];
P2=tab[j];
delay(70);
}
}
}
}