蓝桥杯单片机西风模板 Led底层逻辑

void Led_Disp(unsigned char addr,enable)

{

        static temp =0x00;

        static temp_old=0xff;

if(enable==1)

temp |=0x01<

else

temp &= ~(0x01<

if(temp!=temp_old)

{

P0=~temp;

P2=P2&0x1f|0x80;

P2&=0x1f;

temp_old=temp;

}

}

你可能感兴趣的:(蓝桥杯,单片机,职场和发展)