|
 
#include <reg51.h>
//#include <stdio.h>
#define uchar unsigned char
#define uint unsigned int
void Delay( int t);
void main(void)
{
char i;
Delay(50000);
P1=0xfe;
// Write your code here
while (1)
{
for (i=0;i<8;i++)
{ Delay(50000);
P1 = P1<<1;
P1 = P1 | 0x01;
}
P1 = 0xfe;
}
}
void Delay( int t)
{
while (--t);
}
|
|