这是数码管显示的部分
unsigned char code tab[13]={0x00,0x00,0x00,0x3f,0x05,0x5b,0x4f,0x65,
0x6e,0x7e,0x07,0x7f,0x6f
};
void delay(unsigned int n)
{
unsigned char i,j;
for(i=n;i>0;i--)
for(j=0;j<110;j++);
}
void TEMP_show()
{
a = temp0;
b = temp1;
SMG2 = 1;
P1 = tab[temp1];
delay(5);
SMG2 = 0;
SMG1 = 1;
P1 = tab[temp0];
delay(5);
SMG1 = 0;
}
|