首先,我用的开发板的原理图是
#include <REGX52.H>
#include <INTRINS.H>
void Delay500ms() //@12.000MHz
{
unsigned char i, j, k;
_nop_();
_nop_();
i = 4;
j = 205;
k = 187;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
void main()
{
while(1)
{
P1 = 0xFE;
Delay500ms();
P1 = 0xFD;
Delay500ms();
P1 = 0xFB;
Delay500ms();
P1 = 0xF7;
Delay500ms();
P1 = 0xEF;
Delay500ms();
P1 = 0xDF;
Delay500ms();
P1 = 0xBF;
Delay500ms();
P1 = 0x7F;
Delay500ms();
}
}