我现在需要用数码管显示0~99,但是又觉得16进制转换成10进制太麻烦,所以就试着用查表的方式来进行数值转换,试了一下果然不错。可能各位一直都这么做的,但是我是新手,第一次做这个,做出来还挺高兴的,出来显一下。查表法用于小规模显示还是很好用的。
code char H_O[100] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
16,17,18,19,20,21,22,23,24,25,
32,33,34,35,36,37,38,39,40,41,
48,49,50,51,52,53,54,55,56,57,
64,65,66,67,68,69,70,71,72,73,
80,81,82,83,84,85,86,87,88,89,
96,97,98,99,100,101,102,103,104,105,
112,113,114,115,116,117,118,119,120,121,
128,129,130,131,132,133,134,135,136,137,
144,145,146,147,148,149,150,151,152,153}; |