55 lines
673 B
C
55 lines
673 B
C
#include <reg52.h>
|
|
#include <intrins.h>
|
|
#include "led_mum.h"
|
|
#include "delay.h"
|
|
|
|
unsigned char var1 = 0xfe;
|
|
unsigned char move_flag = 0;
|
|
void move()
|
|
{
|
|
var1 = _crol_(var1, 1);
|
|
P1 = var1;
|
|
}
|
|
|
|
|
|
void int0() interrupt 0
|
|
{
|
|
IE0 = 0;
|
|
delay(40);
|
|
IE0 = 0;
|
|
move_flag = 1;
|
|
}
|
|
|
|
|
|
int main()
|
|
{
|
|
//P1 ÅÜÂíµÆ
|
|
//P0 ѡλ µÍµçƽÁÁ
|
|
//P2 Âë µÍµçƽÁÁ
|
|
|
|
EA = 1;
|
|
IT0 = 1;
|
|
EX0 = 1;
|
|
|
|
while(1)
|
|
{
|
|
if(move_flag)
|
|
{
|
|
move();
|
|
hello_push();
|
|
// num_push();
|
|
move_flag=0;
|
|
}
|
|
// num_display();
|
|
hello_display();
|
|
// hello_full_display();
|
|
|
|
// P2= var1;
|
|
// longdelay();
|
|
// P2=0XFF;
|
|
// delay(2000);
|
|
// P2 = 0x00;
|
|
|
|
}
|
|
|
|
}
|