#include
#include"delay.h"
/*------------------------------------------------
void SendStr(unsigned int s);
unsigned char code DIG_CODE[17]={
0x42,0x06,0x5B,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
unsigned int l;
***it p=P0^0;
void InitUART (void)
{
SCON = 0x50;
TMOD |= 0x20;
TH1 = 0xFD;
TR1 = 1;
EA = 1;
//ES = 1;
}
/*------------------------------------------------
Ö÷º¯Êý
------------------------------------------------*/
void main (void)
{
InitUART();
l=0;
while (l<1)
{
SendStr(5);
DelayMs(240);
DelayMs(240);
DelayMs(240);
DelayMs(240);
l=l+1;
}
while(1);
}
void SendByte(unsigned int dat)
{
SBUF = dat;
TI = 0;
}
void SendStr(unsigned int s)
{ s=0;
while(s<2)
{
SendByte(DIG_CODE);
s++;
}
}
为什么传过去的是0x42却显示A2?求解答啊?