标题: 请高手帮助 [打印本页]
作者: yyi162069635 时间: 2009-12-6 18:22
标题: 请高手帮助
我刚刚接触51单片机,不知道:unsigned char code dispbit[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x40};
作什么用?0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f又是怎样设计得来呢?
作者: linyean 时间: 2009-12-7 10:54
“unsigned char code dispbit[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x40},”
这是定义的数椐表,code 这就是把定义好的数椐表存放ROM中,“0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,”这是由二进制转换得来的,对应“11111110,11111101,11111011,11110111,11101111,11011111,10111111,01111111,”
作者: sophya 时间: 2009-12-7 15:49
你写的好像是数码管的显示代码吧 ,第一个数组是现在数字或者英语字母用的,比如0X3F 可能对应的是0啊 什么的
第二个数组是控制段位的,应该是共阴的吧。
作者: weipeng_apple 时间: 2009-12-7 15:51
楼上正解!
作者: yyi162069635 时间: 2009-12-7 20:21
多谢大家指教
欢迎光临 (http://www.51hei.com/bbs/) |
Powered by Discuz! X3.1 |