Home > other >  A copy of the code
A copy of the code

Time:09-17

Please bosses save the children, always write wrong,

CodePudding user response:

Write a wrong code? The change, and that others have written,

CodePudding user response:

reference 1/f, the wise know already should good karma response:
write wrong code? The change, and not the same, that others have written

# include
# include
Unsigned char code table1 []={x38 x76 0, 0 x79, 0, 0 x38, 0 x3f};
Unsigned char code table2 []={x4f x06 0, 0 x5b, 0, 0 x66, 0 x6d, 0 x7d};
Unsigned char I, j;
Unsigned char temp.
Sbit key=P1 ^ 7;
Bit flag=0;

Void delay (unsigned int time)
{
Unsigned int j=0;
for(; Time> 0; Time -)
for(j=0; j<125; j++);
}
Void fun1 ()
{
Temp=0 xfe;
for(i=0; I<6; I++)
{
P0=table2 [I];
The P2=temp;
Temp=_crol_ (temp, 1);
Delay (1);
The P2=0 XFF;
}
}
Void fun2 ()
{
Temp=0 xfe;
for(i=0; I<5; I++)
{
P0=table1 [I];
The P2=temp;
Temp=_crol_ (temp, 1);
Delay (1);
The P2=0 XFF;
}
}

The main ()
{
While (1)
{
If (key==0)
{
while(! Key);
Flag=~ flag;
}
If (flag)
Fun2 ();
The else
Fun1 ();
}
}

How can this change can hold also showed that

CodePudding user response:

Try
 
The main ()
{
While (1)
{
If (key==0)
{
Flag=~ flag;
while(! Key)
If (flag)
Fun2 ();
The else
Fun1 ();
}
If (flag)
Fun2 ();
The else
Fun1 ();
}
}

CodePudding user response:

Thank you (* °? °)=3, you can!
  • Related