#include <reg52.h>
unsigned char code F_Rotation[4]={0x02,0x04,0x08,0x10};//Õy×a±í¸ñ
unsigned char code B_Rotation[4]={0x10,0x08,0x04,0x02};//·′×a±í¸ñ
void Delay(unsigned int i)//Ñóê±
{
while(--i);
}
main()
{
unsigned char i;
while(1)
{
for(i=0;i<4;i++) //4Ïà
{
P1=F_Rotation[i]; //êä3ö¶Ôó|μÄÏà ¿éòÔ×ÔDD»»3é·′×a±í¸ñ
Delay(500); //¸Ä±äÕa¸ö2Îêy¿éòÔμ÷Õûμç»ú×aËù
}
}
}
|