Hay un problema con el valor de programación del lenguaje C51 del microcontrolador 51. Échale un vistazo.
#include
#define uchar unsigned char
#define uint unsigned int
#define dataport P3
sbit DL=P1^0;
sbit WL=P1^1;
uchar Number_Value[8]={0,0,0,7,0 ,0,0,0};//Cambie el valor de cada elemento en esta matriz para cambiar el valor mostrado por el tubo digital correspondiente
void Ditgital_Scanning(uchar *Numerical)
{
uchar código Second_Code[14]={ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7F,0x6f,0x40,0x00,0x76,0Xff} ?
código uchar Bit_Code[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f} ?
static uchar i=0;
i ==7?i=0:i++; ?
DL = 1;
puerto de datos = 0x00;
DL = 0;
WL = 1;
puerto de datos = Second_Code[Numérico[i]];
WL = 0;?
DL = 1;
puerto de datos = Bit_Code[i];
DL = 0;
}
void main()
{?
TMOD |= 0x01;
TR0 ? = 1;
ET0 = 1;
EA = 1;
while(1) {?
}
}
void Time0_Rountine()interrumpir 1
{
TH0 = 0xfc; //12M o 11.0592M son aceptables
TL0 = 0x66; //1MS
Ditgital_Scanning(Number_Value);< / p>
} ?
/*--------------------------------- - -----------------------------------------
? ¿Tiene alguna pregunta, por favor consulte nuevamente?
---------------------------------- -------------- ------------------------------------ --------------*/