/***********************************************************************/
/* */
/*Project:Running horse LED system 0518 */
/* Date: May 18 2012 */
/* Write : Ilymtics */
/*Contact:ilymtics@msn.com */
/*Describe : Led light move like a horse from left to right */
/***********************************************************************/
#include <reg52.h>
/****************************************************************************/
/* Function :Delay */
/* Describe :Delay cnt crystal frequency in 12MHz */
/****************************************************************************/
void delay(unsigned int cnt)
{
while(--cnt);
}
main()
{
P1=0xFF;
while(1)
{
delay(30000);//delay at crystal frequency in 12MHz
P1=P1>>1;// P1 value move right one time to get new value ,0xef....
if(P1==0)
{
delay(30000);//delay
P1=0xFF;
}
}
}