这是数码管的程序:
const char Disp[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,
//0 1 2 3 4 5 6 7 8 9 A b C d E F
0x76,0x38,0x40,0x3e,0x5c,0x31,0x73,0x10,0xce,0x08,0x08,0x40,0x80,0x02,0xce,0xfd,0x00,0x6e,0x70,0x5c,0x37};
// H L - U o T r _ 18 19 1a 1b 1c 1d 1e 1f 空, 21y 22 N
void Display_string(unsigned int input_value,unsigned char dot_value)
{
unsigned char i,m,code,dat[4];
unsigned int j,temp;
for (i=0;i<4;i++)
{
dat[i] =(char)(input_value>>(3-i)*4)&0x000f;
Led_code[i]=Disp[dat[i]];
}
Led_dot=dot_value;
//Dispaly_Zero(Led_dot);
}
为啥读出的数值总是0小FF,我原来用的是C18编译的,没啥问题啊!现在用XC8 编译的,有问题,请高手指点下,谢谢! |