SCT8951程序的解释以及流程图 跪求大神求解啊
#include "reg51.h"
sbit KEY1 = P1^0;
sbit KEY2 = P1^1;
sbit LED = P1^4;
#define GROUP2 0x02
#define GROUP3 0x03
#define LED_ON(x) {LED = x;}
unsigned char Reset_FLag = 0x00;
void Delay_Ms(unsigned int Ms)
{
unsigned int Ticks = 0x00;
while(Ms --)
{
for(Ticks = 0;Ticks < 120;Ticks ++);
}
}
unsigned char Led_Shift(unsigned char Dat)
{
Dat = (Dat << 1) | (Dat >> 7);
return Dat;
}
void Scan_Key1(unsigned char *temp)
{
if(KEY1 == 0)
{
Delay_Ms(5);
if(KEY1 == 0)
{
Reset_FLag = 0x01;
P2 = *temp;
*temp = Led_Shift(*temp);
while(KEY1 == 0);
}
}
}
void Scan_Key2(unsigned char *temp)
{
if(KEY2 == 0)
{
Delay_Ms(5);
if(KEY2 == 0)
{
Reset_FLag = 0x01;
P3 = *temp;
*temp = Led_Shift(*temp);
while(KEY2 == 0);
}
}
}
int main(void)
{
unsigned char temp1 = 0xFE,temp2 = 0xFE;
LED_ON(0);
while(1)
{
Scan_Key1(&temp1);
Scan_Key2(&temp2);
if((temp1 == temp2) && (0x00 != Reset_FLag))
{
LED_ON(1);
}else{
LED_ON(0);
}
}
}