39 lines
452 B
C
39 lines
452 B
C
#include <reg52.h>
|
|
#include <intrins.h>
|
|
#include "inc.h"
|
|
|
|
static void shortdelay()
|
|
|
|
{
|
|
int i;
|
|
for(i = 10; i > 0; i--);
|
|
}
|
|
|
|
|
|
static void longdelay()
|
|
|
|
{
|
|
int i;
|
|
for(i = 100; i > 0; i--);
|
|
}
|
|
int main()
|
|
{
|
|
//P1 ÅÜÂíµÆ
|
|
//P0 ѡλ µÍµçƽÁÁ
|
|
//P2 Âë µÍµçƽÁÁ
|
|
|
|
unsigned char var1 = 0xfe;
|
|
while(1)
|
|
{ P0=0x00;
|
|
var1 = _crol_(var1, 1);
|
|
P1 = var1;
|
|
|
|
P2= var1;
|
|
// longdelay();
|
|
// P2=0XFF;
|
|
delay(2000);
|
|
// P2 = 0x00;
|
|
|
|
}
|
|
|
|
}
|