Home > other >  Microcontroller c51 programming error C202: & # x27; The p2 & # x27; : undefined identifier and grea
Microcontroller c51 programming error C202: & # x27; The p2 & # x27; : undefined identifier and grea

Time:10-12

#include
# define uchar unsigned char
# define unit unsigned int
Sbit dula=P2 ^ 6;
Sbit wela=p2 ^ 7;
P1 sbit led1=^ 0;
Uchar code table []={x5b x3f 0, 0 x06, 0, 0 x4f,
X6d 0 x66, 0, 0 x7d, 0 x07,
X6f 0 x7f, 0, 0 x77, 0 x7c,
X5e 0 x39, 0, 0 x79, 0 x71};
Void delayms (uint);
Void the display (uchar, uchar);
Uchar num, num1, num2, shi, ge;
Void main ()
{TMOD=0 x11;
TH0=(65536-48572)/256;
TL0=(65536-48572) % 256;
TH1=(65536-48572)/256;
TL1=(65536-48572) % 256;
EA=1;
ET0=1;
ET1=1;
TR0=1;
TR1=1;
While (1)
{
The display (shi ge);
}
}
Void the display (uchar shi, uchar ge)
{
Dula=1;
P0=table (shi);
Dula=0;
P0=0 XFF;
Wela=1;
P0=0 xfe;
Wela=0;
Delayms (5);
Dula=1;
P0=table (ge),
Dula=0;
P0=0 XFF;
Wela=1;
P0=0 XFD;
Wela=0;
Delayms (5);
}
Void delayms (uint XMS)
{
Uint I, j;
For (I=XMS; i> 0; I -)
For (j=110; J> 0; J -);
}
Void T0_time () interrupt 1
{
TH0=(65536-45872)/256;
TL0=(65536-45872) % 256;
Num1 + +;
If (num1==4)
{
Num1=0;
Led1=~ led1;
}
}
Void T1_time () interrupt 3
{
TH1=(65536-45872)/256;
TL1=(65536-45872) % 256;
Num2 + +
If (num2==20)
{
Num2=0;
num++;
If (num==60)
num=0;
Shi=num/10;
Ge=num % 10;
}
}

CodePudding user response:

Port character in capital, tips are already very understand lowercase, want serious difference between upper and lower case characters,
  • Related