4个灯
追答#include
#include
char xx = 1, n1 = 0, n2 = 0;
void main()
{
TMOD = 1;
TH0 = 0x3C;
TL0 = 0xB0;
TR0 = 1;
IE = 0x82;
while (1) {
if(n1 == 2) {
n1 = 0;
P1 ^= xx;
n2++;
if(n2 == 10) {
n2 = 0;
xx = _crol_(xx, 1);
if(xx == 16) xx = 1;
} } }
}
void T0_INT () interrupt 1
{
TH0 = 0x3C;
TL0 = 0xB0;
n1++;
}