888光立方源程序 简单
光立方设计文档
8*8*8光立方摘要本设计制作出一个三维立体显示图案的LED光立方。
不仅可以像发光二极管点阵一样显示平面的静态或动态画面,还可以显示立体的静态或动态画面,打破了传统的平面显示方案。
同时又增加了显示的花样和立体图案显示效果,可以广泛用于传媒信息显示和各种装饰显示,光立方显示比发光二极管点阵更具有视觉效果,而且画面图案更加非富多彩。
本设计是采用STC15W4K58S4单片机为核心控制器,74HC595扩展I/O口,完成硬件电路设计。
通过软件编程控制数据下载到单片机完成设计图案的显示。
软件采用自上而下的模块化设计思想,使系统朝着分布式、小型化方向发展,增强系统的可扩展性和运行的稳定性。
关键词STC15W4K58S4单片机; ULN2803驱动管;74HC595。
目录8*8*8光立方 (1)1、设计要求与方案 (1)1.1 设计目的 (1)1.2 设计思路 (1)2、工作原理 (1)2.1模块的简介 (1)2.2 8*8*8光立方工作原理 (1)3、方案选择 (2)3.1电源的选择 (2)3.23D显示核心控制芯片 (3)3.3I/O口扩展芯片的选择 (3)3.4LED发光显示二级管 (3)4、硬件整体设计概述及功能分析 (3)4.1系统概述 (4)4.2系列单片机简介 (5)4.3时钟电路设计 (5)4.4 复位电路设计 (5)4.5 74HC5795芯片连接电路图与介绍 (6)5、主程序设计思路 (7)5.1显示程序的设计 (7)6、硬件电路设计 (8)6.1焊接准备 (8)6.2 焊接步骤 (8)6.3 焊接技巧 (8)7、收获总结 (9)1、设计要求与方案1.1 设计目的在当今的信息化社会中,为追求逼真、清晰的3D视频显示,平面的二位显示早已不在是主流,为此制作出一个三维立体显示图案的LED光立方。
该设计方案将打破了传统的平面显示视频的方法,该方案设计的LED显示屏显示画面色彩鲜艳,立体感强,可以广泛应用于各种工场合的多种用途。
cube8制作(完整:含原理图、代码)介绍
COU4 U4 1 OC NLX3 PIU401 X3 11 PIU4011 C
Y0 PIU402 2 1D Y1 PIU403 3 2D Y2 PIU404 4 3D Y3 PIU405 5 4D Y4 PIU406 6 5D Y5 PIU407 7 6D Y6 PIU408 8 7D Y7 PIU409 9 8D
PIS20 PIS203
PIC1302
PIY102 PIY10
Y1 COY1 24M GND
CLKOUT2/ADC0/P1.0 VCC ADC1/P1.1 P0.0 RXD2/ECI/ADC2/P1.2 P0.1 TXD2/CPP0/ADC3/P1.3 P0.2 SS/CPP1/ADC4/P1.4 P0.3 MOSI/ADC5/P1.5 P0.4 MISO/ADC6/P1.6 P0.5 SCLK/ADC7/P1.7 P0.6 P4.7/RST P0.7 INT/RXD/P3.0 EX_LVD/P4.6 TXD/P3.1 ALE/P4.5 P3.2/INT0 NA/P4.4 P3.3/INT1 P2.7/A15 CLKOUT0/INT/T0/P3.4 P2.6/A14 CLKOUT1/INT/T1/P3.5 P2.5/A13 P3.6/WR P2.4/A12 P3.7/RD P2.3/A11 XTAL2 P2.2/A10 XTAL1 P2.1/A9 GND P2.0/A8
PIU302
GND
COP3 P3 19 1Q PIU3019PIP301 1 18 2Q PIU3018PIP302 2 17 3Q PIU3017PIP303 3 16 4Q PIU3016PIP304 4 15 5Q PIU3015PIP305 5 14 6Q PIU3014PIP306 6 13 7Q PIU3013PIP307 7 12 PIU3012 PIP308 8 8Q
888光立方仿真
如此组成一个灯板,8 次循环下来,就全部灯都点亮了*/
}
void liang()
//点亮所有的灯
{
unsigned int i;
for(i=0;i<5000;i++)
{
DataPort=0x00; //先给行(灯板的公共端)输入数据
line_LATCH=1; //打开锁存,把数据 0x00 放进去
line_LATCH=0; //关闭锁存,阻止外部数据进来
DataPort=Data[8+i]; //把数组 Data[8~15]里的值依次传给第二灯板的 573 锁存器中 LATCH2=1;LATCH2=0;
DataPort=Data[16+i]; //把数组 Data[16~23]里的值依次传给第三灯板的 573 锁存器中 LATCH3=1;LATCH3=0;
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; unsigned char code laihui1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; unsigned char code laihui2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; unsigned char code laihui3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; unsigned char code laihui4[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; unsigned char code laihui5[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
888光立方课程设计
888光立方课程设计一、教学目标本课程的教学目标是让学生掌握光立方的基本原理和制作方法,培养学生的创新意识和动手能力。
具体分为三个部分:1.知识目标:学生能够理解光立方的物理原理,包括光的传播、反射、折射等;掌握光立方的制作流程和技巧。
2.技能目标:学生能够运用光立方原理,独立完成一个光立方的设计和制作;培养学生的团队协作能力和问题解决能力。
3.情感态度价值观目标:学生能够认识到光立方在科技领域的应用价值,激发对科技创新的热爱和好奇心;培养学生的创新精神和实践能力。
二、教学内容本课程的教学内容主要包括光立方的原理、制作方法和应用。
具体安排如下:1.第一章:光立方概述,介绍光立方的定义、发展历程和应用领域;2.第二章:光立方的物理原理,讲解光的基本性质、光的传播、反射、折射等现象;3.第三章:光立方的制作材料和工具,介绍光立方制作所需的材料、工具及其使用方法;4.第四章:光立方的制作流程,讲解光立方的设计、搭建、调试和优化等环节;5.第五章:光立方的创新应用,介绍光立方在各个领域的应用案例,探讨光立方的未来发展。
三、教学方法为了提高教学效果,本课程采用多种教学方法相结合的方式,包括:1.讲授法:教师讲解光立方的基本原理、制作方法和应用,引导学生掌握相关知识;2.实践操作法:学生动手制作光立方,培养学生的实践能力和创新意识;3.案例分析法:分析光立方的实际应用案例,帮助学生了解光立方的应用价值;4.小组讨论法:学生分组讨论光立方的制作过程中的问题,培养团队协作能力。
四、教学资源为了支持教学内容的实施,本课程准备以下教学资源:1.教材:《光立方制作教程》,为学生提供系统的学习材料;2.参考书:《光学原理与应用》、《创新制作教程》等,为学生提供拓展阅读资料;3.多媒体资料:制作光立方的视频教程、动画演示等,帮助学生更好地理解光立方的制作过程;4.实验设备:为学生提供光立方制作所需的实验材料和设备,如LED灯、电路板、显微镜等。
光立方制作+程序讲解
光立方教程今天,给大家带来光立方的制作教程,基于本人制作的经验,给各位想要做的朋友分享制作过程。
对于第一次制作的朋友,我们要先制作好一个日程表,如下图:我们要弄好一个计划,就好像单片机运行程序一样。
当然,废话少说。
接下来,我们需要一份购买材料的清单如上图所示,我们需要购买的万能板需要购买18*30的规格。
这样子才有足够的空间去安装我们的电子元件。
首先,我们需要用万能板作为骨架,每2cm*2cm就要焊接一个排针,上下左右间隔一样。
不过对于初学者来说,一次性焊接64颗排针有点困难,所以我们需要用胶布把每一颗排针固定好,然后上焊,当然这是一个快捷的方法,也适合所有的初学者当我们把排针固定好后,我们只需要把板子翻过来焊接就可以了。
接下来,我们要把每一颗led灯折弯后侧着放置在排针中。
从左到右,从上至下的安放,安放好后,我们只需要把他们的脚焊接即可。
折弯时记住使用镊子折弯。
效果图如下图所示显而易见,这是非常需要考焊功的活,各位制作时候要注意节点与节点之间的间距,并且注意焊点不要点太多的锡,会影响做出来的效果与美观。
接下来,我们把弄好的8排led插在万能板上,注意:我们要注意每排之间的间隔。
下一步,我们需要在把每排led的共阴极连接在一起,一共8层,每层都要连接好,当我们把每层连接好后,我们要在每层的末端或者初始端接一条输出线,作为共阴极连接UNL2803。
当然,我们连接UNL2803的前提是先把芯片接好。
小编我直接把芯片焊接在板子上,这种方法对于初学者来说不可取,需要弄芯片底座,不然芯片烧掉了就很难拆下来了。
接下来我们要按照电路图接线路了(是不是很开心,终于可以接线路了,好戏在后头),下面是74HC573集成电路的接法:首先我们先分析一下原理图:74HC573的1D~8D都连接在一起,然后再接到单片机的P0.0~P0.7端口;1Q~8Q分别连接每排的共阳里,就是焊接在电路板上的光立方引脚;至于LE要分别接到单片机的P2.0~P2.7。
888光立方制作教程
虽说光立方教程早已烂大街了,但是做出来成就感还是不错的,不发帖就
太亏了,个人建议是能别做就别做,应为这玩意没多大难度,考验的就是耐
心了。废话不说了,下面请看教程。
/*************************************分割线
**********************************/
材料:
5mm雾装led 512个(个人建议用蓝色,效果好一些)共47元;
洞洞板15x18cm 2块(买大一点的好些)共6元;
stc单片机12a5c60s2一片(此款内存较大)共5元;
焊锡自备;
下载器自备;
排针多买几片备用自备;
排插多买几片备用自备;
uln2803达林顿管一个共0.5元;
74hc573 8个共6元;
然后就烂了,我也就呵呵呵了。。如果大家有什幺不明白的,就回复向我
提问吧!乐意解答!!!注意了,大家一定要把烙铁接地,不要问我为什幺
(这样可以防静电),我犹豫没有接地,然后,就成了上面这个样子了,这是
痛苦。有点悲哀。完了。。
导线方式
然后就是链接起来通电测试。。。。。。。。
然而现实并不是这样美好,没错,led被静电击穿了不少,太难修理了,
所以我放弃了!!!!!
能算上半成功,晶振大家用24mhz的吧,程序跑起来能快些。程序是能
跑的!
本来打算上视频的,然而,,,,,,,,,大风崔掉了他的锐气,没错,他被大
风崔到了地上!!!!!
奈。
附上点阵电路,网上抄的,随便看一下,你高兴就行。
把板子喷了,好看一些。(瞬间高大上了,有没有!!)
按照点阵方式焊吧,一共要64片,焊到吐。(注意焊的时间)
光立方教程(含HEX烧录文件)
先上效果图首先,准备材料和工具。
材料:1, 雾面蓝色(喜欢其他色的随意)LED (3MM 或者5MM 都行),最好是雾面LED ,不懂得购买的时候跟老板说清楚就ok~2,STC12C5A60S2单片机一片3,DIP-40的插座一个4,22.1184MHZ晶振一个5,单排圆孔插针座20个(建议多准备些)6,单排插针4个7,USB母座一个8,0.3--0.8镀锡铜线一米左右,没有的也行,根据自己的焊接习惯。
个人比较喜欢镀锡铜线。
工具1,剪线钳2,尖嘴钳3,电烙铁4,焊丝5,松香6,镊子7,其他(总之就是焊接用的那些了,根据个人情况。
)———————————分割线———————————首先,电路图很简单了电路图很简单,稍微有点单片机基础都可以做。
然后呢,开动你灵活的小左和小右吧~准备绘制焊接图纸。
首先,确定你要做多大尺寸的光立方,4*4*4也就是64个灯,个人感觉做成7厘米见方左右就差不多了。
根据个人喜好调节吧~大小具体怎样确定呢,二少在这里简单说明一下,每一边是4个灯,也就是三个灯距,灯距的三倍加两个灯宽就是边长了。
灯距的确定,不是随便确定的,必须是2.54毫米的整数倍,为什么呢,因为洞洞板的孔距就是2.54,最后的灯是插在洞洞板上的。
本教程所定的灯距是4倍的孔距,也就是10毫米挂点,小误差这里就可以忽略了。
OK~根据灯的情况,确定洞洞板的大小,最少得是20孔,因为单片机用的是DIP40的,所以至少要保证单片机可以安装,当然高手还可以立式安装单片机,二少在这里就不多介绍了。
确定以上参数后,好了,开始制作吧~我这边手头有的洞洞板是19*23孔的,所以嘛~单片机就有俩引脚是悬空的,不过不影响。
焊接电路,(绘制软件,layout)然后,确定单片机和LED灯体的安装位置。
并做简单标注。
用尖嘴钳把插针掰成一个一个的,直接焊接于绿色的焊盘位置,4*4+4个。
如下图效果单片机最好安装在座子上,直接焊接死亡率较高。
888光立方
网友谢路春制作的光立方,8 x 8 x 8 尺寸,相当不错。
视频欣赏下面是制作过程中的照片,可惜少了点文字说明,希望他能抽空分享一下制作经验。
补充作者说明(2011-11-07):大家好,我是作者。
我自从在本网站看到光立方后就一直有想自己做一个的想法,888光立方,工程浩大,我又怕我会半途而废,所以先做了个小的。
就是上图PCB板上那个,较丑,较乱的(是444光立方,这个属于工程验证品)。
经过一段时间的努力,尽然获得了成功,之后我就有了做大的信心了。
做这个很需要耐心。
下面简单讲一下立方体的连接规律:光立方从下到上共8层,每一层64个LED的负极接到一起(说明一下,从上看架子上有好多铜线,其实不要在电路也是可以的,它们起保持架子结构作用),第一层64个正极单独引出,第二层的每个正极分别接到它对应第一层正极,第三层的正极接第二层的正极。
就是竖着看是8个接到一个正极上。
整个光立方引出8 个层引出线加上64个正极引出线,共引出72根线。
(我的架子间隔是2cm,正好用LED的引脚,LED的引脚是要用钳子折出形状的,在此讲不明白,同志自己研究吧)。
再讲一下,光立方的工作原理:单片机先送出8字节数据,即64位,再选择第一层,点亮或熄灭第一层的64个LED,然后再送出8字节数据,选择第二层,依次类推。
到第8层后,再到第一层,接着循环。
就是用单片机的定时中断扫描。
程序方面,定义一个二维数组,如cube[8][8],第一个8代表8层,第二个8代表每层的8行,每字节的8位代表每行中的8个LED。
改变这个数组即改变了光立方。
电路板焊接方面比较简单,照着从本网站下载的资料中电路图焊就行了(那个电路图要用eagle才能打开,先到百度里输入eagle搜一下就能下载到),应该先把整个IC的座子焊完后再装IC,不然有焊坏IC的可能。
用万能板焊,要飞很多跳线,要很有耐心。
架子要想焊的好也一样。
同志们要坚持住啊。
不好讲,语文能力有限就讲这么多了。
光立方制作+程序
光立方教程今天,给大家带来光立方的制作教程,基于本人制作的经验,给各位想要做的朋友分享制作过程。
对于第一次制作的朋友,我们要先制作好一个日程表,如下图:我们要弄好一个计划,就好像单片机运行程序一样。
当然,废话少说。
接下来,我们需要一份购买材料的清单如上图所示,我们需要购买的万能板需要购买18*30的规格。
这样子才有足够的空间去安装我们的电子元件。
首先,我们需要用万能板作为骨架,每2cm*2cm就要焊接一个排针,上下左右间隔一样。
不过对于初学者来说,一次性焊接64颗排针有点困难,所以我们需要用胶布把每一颗排针固定好,然后上焊,当然这是一个快捷的方法,也适合所有的初学者当我们把排针固定好后,我们只需要把板子翻过来焊接就可以了。
接下来,我们要把每一颗led灯折弯后侧着放置在排针中。
从左到右,从上至下的安放,安放好后,我们只需要把他们的脚焊接即可。
折弯时记住使用镊子折弯。
效果图如下图所示显而易见,这是非常需要考焊功的活,各位制作时候要注意节点与节点之间的间距,并且注意焊点不要点太多的锡,会影响做出来的效果与美观。
接下来,我们把弄好的8排led插在万能板上,注意:我们要注意每排之间的间隔。
下一步,我们需要在把每排led的共阴极连接在一起,一共8层,每层都要连接好,当我们把每层连接好后,我们要在每层的末端或者初始端接一条输出线,作为共阴极连接UNL2803。
当然,我们连接UNL2803的前提是先把芯片接好。
小编我直接把芯片焊接在板子上,这种方法对于初学者来说不可取,需要弄芯片底座,不然芯片烧掉了就很难拆下来了。
接下来我们要按照电路图接线路了(是不是很开心,终于可以接线路了,好戏在后头),下面是74HC573集成电路的接法:首先我们先分析一下原理图:74HC573的1D~8D都连接在一起,然后再接到单片机的P0.0~P0.7端口;1Q~8Q分别连接每排的共阳里,就是焊接在电路板上的光立方引脚;至于LE要分别接到单片机的P2.0~P2.7。
888光立方练习代码
{
while(hwz==0x45)
{led1=0;X=0X016;Z=0X016;Y=0X16;//P4控制Z轴;P0控制X轴;P2控制Y轴;
}
while(hwz==0x46)
{ led1=1;
X=0X00;Y=0X00;Z=0X00;
};
}
}
//三维串口通信
#include<STC15f2k60S2.h>
}
voiddelay1(intt)
{
chari;
while(t--)
for(i=0;i<20;i++);
}
/********oìía?óê±********/
voidDelay2100us()//@12.000MHz
{
unsignedchari, j;
i= 25;
j = 127;
do
{
while(--j);
EA=1;
ET0=1;
TR0=0;
EX0=1; //允许总中断中断,使能INT0外部中断
IT0=1; //触发方式为脉冲负边沿触发
IRIN=1; //I/O口初始化
}
/*************主函数******************/
voidmain()
{inti;
delay(800);
init();//初始化函数
{
unsignedchari, j;
_nop_();
_nop_();
i= 2;
j = 158;
do
{
while(--j);
} while (--i);
}
/*****************½âÂë¹ý³Ì***************/
光立方_毕业论文(含程序原理图实物图)
目录摘要 .......................................................................................................................................................... X XX 关键词 ...................................................................................................................................................... X XX 1绪论 . 02总体设计 (1)工作原理 (1)各模块方案选择与论证 (1)单片机主控制模块 (1)驱动模块 (1)显示模块 (1)图2-2 雾面乳型LED灯 (2)3 系统硬件电路设计与实现 (2)硬件电路设计 (2)单片机最小系统 (2)驱动模块的设计 (4)主程序设计 (8)系统调试 (9)硬件测试 (9)软件测试 (10)结果分析 (10)6结论 (11)Keywords (13)致谢语 (14) (16) (16)程序清单 (17)#include <> (17)#define uchar unsigned char (17)#define uint unsigned int (17)sbit p30 = P1^0; (17)sbit p31 = P1^1; (17)sbit p32 = P1^2; (17)sbit p33 = P1^3; (17)sbit p34 = P1^4; (17)sbit p35 = P1^5; (17)sbit p36 = P1^6; (17)sbit p37 = P1^7; (17)uchar display[8][8]; (17)/*rank:A,1,2,3,4,I,心,U*/ (17)uchar code table_cha[8][8]={0x51,0x51,0x51,0x4a,0x4a,0x4a,0x44,0x44,0x18,0x1c,0x18,0x18,0x18, 0x18,0x18,0x3c,0x3c,0x66,0x66,0x30,0x18,0xc,0x6,0xf6,0x3c,0x66,0x60,0x38,0x60,0x60 ,0x66,0x3c,0x30,0x38,0x3c,0x3e,0x36,0x7e,0x30,0x30,0x3c,0x3c,0x18,0x18,0x18,0x18,0 x3c,0x3c,0x66,0xff,0xff,0xff,0x7e,0x3c,0x18,0x18,0x66,0x66,0x66,0x66,0x66,0x66,0x7 e,0x3c}; (17)/*the "ideasoft"*/ (17)uchar code table_id[40]={0x81,0xff,0x81,0x00,0xff,0x81,0x81,0x7e,0x00,0xff,0x89,0x89,0x00,0xf 8,0x27,0x27,0xf8,0x00,0x8f,0x89,0x89,0xf9,0x00,0xff,0x81,0x81,0xff,0x00,0xff,0x09, 0x09,0x09,0x01,0x0,0x01,0x01,0xff,0x01,0x01,0x00}; (17)/*railway*/ (17)uchar code dat[128]={0x0,0x20,0x40,0x60,0x80,0xa0,0xc0,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xf c,0xdc,0xbc,0x9c,0x7c,0x5c,0x3c,0x1c,0x18,0x14,0x10,0xc,0x8,0x4,0x25,0x45,0x65,0x8 5,0xa5,0xc5,0xc9,0xcd,0xd1,0xd5,0xd9,0xb9,0x99,0x79,0x59,0x39,0x35,0x31,0x2d,0x29, 0x4a,0x6a,0x8a,0xaa,0xae,0xb2,0xb6,0x96,0x76,0x56,0x52,0x4e,0x6f,0x8f,0x93,0x73,0x 6f,0x8f,0x93,0x73,0x4a,0x6a,0x8a,0xaa,0xae,0xb2,0xb6,0x96,0x76,0x56,0x52,0x4e,0x25 ,0x45,0x65,0x85,0xa5,0xc5,0xc9,0xcd,0xd1,0xd5,0xd9,0xb9,0x99,0x79,0x59,0x39,0x35,0 x31,0x2d,0x29,0x0,0x20,0x40,0x60,0x80,0xa0,0xc0,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8 ,0xfc,0xdc,0xbc,0x9c,0x7c,0x5c,0x3c,0x1c,0x18,0x14,0x10,0xc,0x8,0x4}; (17)/*railway 2*/ (17)uchar code dat2[28]={0x0,0x20,0x40,0x60,0x80,0xa0,0xc0,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xf c,0xdc,0xbc,0x9c,0x7c,0x5c,0x3c,0x1c,0x18,0x14,0x10,0xc,0x8,0x4}; (17)/*railway 3*/ (17)uchar code dat3[24]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x16,0x26,0x36,0x46,0x56,0x66,0x65,0x 64,0x63,0x62,0x61,0x60,0x50,0x40,0x30,0x20,0x10}; (17)/*3p char*/ (17)uchar codex3f,0x1f,0x0e,0x18,0x3c,0x7e,0xff,0x18,0x18,0x18,0x18}; (17)/*initializtion (17)That is to initialize the program (17)It is write to set the timer in c52 mcu (17)So the program can renovate the led_3d_cube in fixed time use the interrupt function.*/ (17)void sinter() (17){ (17)IE=0x82; (17)TCON=0x01; (17)TH0=0xc0; (17)TL0=0; (17)TR0=1; (17)} (17)void delay5us(void) 误差 STC 1T (18){ (18)unsigned char a,b; (18)for(b=7;b>0;b--) (18)for(a=2;a>0;a--); (18)} (18)void delay(uint i) (18){ (18)while (i--){ (18)delay5us();}12t的mcu 注释这个延时即可 (18)} (18)/*To judge the num bit*/ (18)uchar judgebit(uchar num,uchar b) (18){ (18)char n; (18)num=num&(1<<b); (18)if (num) (18)n=1; (18)else (18)n=0; (18)return n; (18)} (18)/*To figure out the round number*/ (18)uchar abs(uchar a) (18){ (18)uchar b; (18)b=a/10; (18)a=a-b*10; (18)if (a>=5) (18)b++; (18)/*To figure out the absolute value*/ (18)uchar abss(char a) (18){ (18)if (a<0) (18)a=-a; (18)return a; (18)} (18)/*The function can comparat the character (18)And remove the big one to the back.*/ (18)void max(uchar *a,uchar *b) (18){ (18)uchar t; (18)if ((*a)>(*b)) (18){ (18)t=(*a); (18)(*a)=(*b); (19)(*b)=t; (19)} (19)} (19)/*The function is to figure out the max number and return it.*/ (19)uchar maxt(uchar a,uchar b,uchar c) (19){ (19)if (a<b) (19)a=b; (19)if (a<c) (19)a=c; (19)return a; (19)} (19)void clear(char le) (19){ (19)uchar i,j; (19)for (j=0;j<8;j++) (19){ (19)for (i=0;i<8;i++) (19)display[j][i]=le; (19)} (19)} (19)void trailler(uint speed) (19){ (19)char i,j; (19)for (i=6;i>=-3;i--) (19){ (19)if (i>=0) (19)display[j][i]=display[j][i+1]; (19)} (19)if (i<4) (19){ (19)for (j=0;j<8;j++) (19)display[j][i+4]=0; (19)} (19)delay(speed); (19)} (19)} (19)void point(uchar x,uchar y,uchar z,uchar le) (19){ (19)uchar ch1,ch0; (19)ch1=1<<x; (19)ch0=~ch1; (20)if (le) (20)display[z][y]=display[z][y]|ch1; (20)else (20)display[z][y]=display[z][y]&ch0; (20)} (20)void type(uchar cha,uchar y) (20){ (20)uchar xx; (20)for (xx=0;xx<8;xx++) (20){ (20)display[xx][y]=table_cha[cha][xx]; (20)} (20)} (20)/*The first variable is the distance from the midpoint. (20)The second is the layer (20)the third is the flash speed of the time between each two point. (20)The forth is the enable io,it controls weather draw or claen.*/ (20)void cirp(char cpp,uchar dir,uchar le) (20){ (20)uchar a,b,c,cp; (20)if ((cpp<128)&(cpp>=0)) (20){ (20)if (dir) (20)cp=127-cpp; (20)else (20)cp=cpp; (20)a=(dat[cp]>>5)&0x07; (20)b=(dat[cp]>>2)&0x07; (20)c=7-c; (20)point (a,b,c,le); (20)} (20)} (20)void line(uchar x1,uchar y1,uchar z1,uchar x2,uchar y2,uchar z2,uchar le) (20){ (20)char t,a,b,c,a1,b1,c1,i; (20)a1=x2-x1; (20)b1=y2-y1; (20)c1=z2-z1; (20)t=maxt(abss(a1),abss(b1),abss(c1)); (20)a=x1*10; (20)b=y1*10; (21)c=z1*10; (21)a1=a1*10/t; (21)b1=b1*10/t; (21)c1=c1*10/t; (21)for (i=0;i<t;i++) (21){ (21)point(abs(a),abs(b),abs(c),le); (21)a+=a1; (21)b+=b1; (21)c+=c1; (21)} (21)point(x2,y2,z2,le); (21)} (21)void box(uchar x1,uchar y1,uchar z1,uchar x2,uchar y2,uchar z2,uchar fill,uchar le) (21){ (21)uchar i,j,t=0; (21)max(&x1,&x2); (21)max(&y1,&y2); (21)max(&z1,&z2); (21)for (i=x1;i<=x2;i++) (21)t|=1<<i; (21)if (!le) (21)t=~t; (21)if (fill) (21){ (21)if (le) (21){ (21)for (i=z1;i<=z2;i++) (21){ (21)} (21)} (21)else (21){ (21)for (i=z1;i<=z2;i++) (21){ (21)for (j=y1;j<=y2;j++) (21)display[j][i]&=t; (21)} (21)} (21)} (21)else (21){ (22)if (le) (22){ (22)display[y1][z1]|=t; (22)display[y2][z1]|=t; (22)display[y1][z2]|=t; (22)display[y2][z2]|=t; (22)} (22)else (22){ (22)display[y1][z1]&=t; (22)display[y2][z1]&=t; (22)display[y1][z2]&=t; (22)display[y2][z2]&=t; (22)} (22)t=(0x01<<x1)|(0x01<<x2); (22)if (!le) (22)t=~t; (22)if (le) (22){ (22)for (j=z1;j<=z2;j+=(z2-z1)) (22){ (22)for (i=y1;i<=y2;i++) (22)display[i][j]|=t; (22)} (22)for (j=y1;j<=y2;j+=(y2-y1)) (22){ (22)for (i=z1;i<=z2;i++) (22)display[j][i]|=t; (22)} (22)} (22)for (j=z1;j<=z2;j+=(z2-z1)) (22){ (22)for (i=y1;i<=y2;i++) (22){ (22)display[i][j]&=t; (22)} (22)} (22)for (j=y1;j<=y2;j+=(y2-y1)) (22){ (22)for (i=z1;i<=z2;i++) (22){ (23)display[j][i]&=t; (23)} (23)} (23)} (23)} (23)} (23)void box_apeak_xy(uchar x1,uchar y1,uchar z1,uchar x2,uchar y2,uchar z2,uchar fill,uchar le) (23){ (23)uchar i; (23)max(&z1,&z2); (23)if (fill) (23){ (23)for (i=z1;i<=z2;i++) (23){ (23)line (x1,y1,i,x2,y2,i,le); (23)} (23)} (23)else (23){ (23)line (x1,y1,z1,x2,y2,z1,le); (23)line (x1,y1,z2,x2,y2,z2,le); (23)line (x2,y2,z1,x2,y2,z2,le); (23)line (x1,y1,z1,x1,y1,z2,le); (23)} (23)} (23)void poke(uchar n,uchar x,uchar y) (23){ (23)uchar i; (23)for (i=0;i<8;i++) (23){ (23)point(x,y,i,judgebit(n,i)); (23)void boxtola(char i,uchar n) (23){ (23)if ((i>=0)&(i<8)) (23){ (23)poke(n,0,7-i); (23)} (23)if ((i>=8)&(i<16)) (23){ (23)poke(n,i-8,0); (23)} (24)if ((i>=16)&(i<24)) (24){ (24)poke(n,7,i-16); (24)} (24)} (24)void rolldisplay(uint speed) (24){ (24)uchar j; (24)char i,a; (24)for (i=23;i>-40;i--) (24){ (24)for (j=0;j<40;j++) (24){ (24)a=i+j; (24)if ((a>=0)&(a<24)) (24)boxtola(a,table_id[j]); (24)} (24)delay(speed); (24)} (24)} (24)void roll_apeak_yz(uchar n,uint speed) (24){ (24)uchar i; (24)switch(n) (24){ (24)case 1: (24)for (i=0;i<7;i++) (24){ (24)display[i][7]=0; (24)display[7][6-i]=255; (24)delay(speed); (24)}; (24)break; (24){ (24)display[7][7-i]=0; (24)display[6-i][0]=255; (24)delay(speed); (24)}; (24)break; (24)case 3: (24)for (i=0;i<7;i++) (25){ (25)display[7-i][0]=0; (25)display[0][i+1]=255; (25)delay(speed); (25)}; (25)break; (25)case 0: (25)for (i=0;i<7;i++) (25){ (25)display[0][i]=0; (25)display[i+1][7]=255; (25)delay(speed); (25)}; (25)} (25)} (25)void roll_apeak_xy(uchar n,uint speed) (25){ (25)uchar i; (25)switch(n) (25){ (25)case 1: (25)for (i=0;i<7;i++) (25){ (25)line(0,i,0,0,i,7,0); (25)line(i+1,7,0,i+1,7,7,1); (25)delay(speed); (25)}; (25)break; (25)case 2: (25)for (i=0;i<7;i++) (25){ (25)line(i,7,0,i,7,7,0); (25)line(7,6-i,0,7,6-i,7,1); (25)delay(speed); (25)}; (25)for (i=0;i<7;i++) (25){ (25)line(7,7-i,0,7,7-i,7,0); (25)line(6-i,0,0,6-i,0,7,1); (25)delay(speed); (25)}; (26)break; (26)case 0: (26)for (i=0;i<7;i++) (26){ (26)line(7-i,0,0,7-i,0,7,0); (26)line(0,i+1,0,0,i+1,7,1); (26)delay(speed); (26)}; (26)} (26)} (26)void roll_3_xy(uchar n,uint speed) (26){ (26)uchar i; (26)switch(n) (26){ (26)case 1: (26)for (i=0;i<8;i++) (26){ (26)box_apeak_xy (0,i,0,7,7-i,7,1,1); (26)delay(speed); (26)if (i<7) (26)box_apeak_xy (3,3,0,0,i,7,1,0); (26)}; (26)break; (26)case 2: (26)for (i=0;i<8;i++) (26){ (26)box_apeak_xy (7-i,0,0,i,7,7,1,1); (26)delay(speed); (26)if (i<7) (26)box_apeak_xy (3,4,0,i,7,7,1,0); (26)}; (26)break; (26)case 3: (26)for (i=0;i<8;i++) (26){ (26)box_apeak_xy (0,i,0,7,7-i,7,1,1); (26)box_apeak_xy (4,4,0,7,7-i,7,1,0); (26)}; (26)break; (26)case 0: (26)for (i=0;i<8;i++) (27){ (27)box_apeak_xy (7-i,0,0,i,7,7,1,1); (27)delay(speed); (27)if (i<7) (27)box_apeak_xy (4,3,0,7-i,0,7,1,0); (27)}; (27)} (27)} (27)void trans(uchar z,uint speed) (27){ (27)uchar i,j; (27)for (j=0;j<8;j++) (27){ (27)for (i=0;i<8;i++) (27){ (27)display[z][i]>>=1; (27)} (27)delay(speed); (27)} (27)} (27)void tranoutchar(uchar c,uint speed) (27){ (27)uchar i,j,k,a,i2=0; (27)for (i=0;i<8;i++) (27){ (27)if (i<7) (27)box_apeak_xy (i+1,0,0,i+1,7,7,1,1); (27)box_apeak_xy (i2,0,0,i2,7,7,1,0); (27)a=0; (27)i2=i+1; (27)for (j=0;j<=i;j++) (27){ (27)a=a|(1<<j); (27)} (27)for (k=0;k<8;k++) (27){ (27)display[k][3]|=table_cha[c][k]&a; (27)display[k][4]|=table_cha[c][k]&a; (27)} (27)} (27)void transss() (28){ (28)uchar i,j; (28)for (i=0;i<8;i++) (28){ (28)for (j=0;j<8;j++) (28)display[i][j]<<=1; (28)} (28)} (28)/*From now on,the function below is to display the flash.*/ (28)void flash_1() (28){ (28)clear(0); (28)type(1,0); (28)delay(60000); (28)type(2,0); (28)delay(60000); (28)type(3,0); (28)delay(60000); (28)type(4,0); (28)delay(60000); (28)delay(60000); (28)clear(0); (28)rolldisplay(30000); (28)type(0,7); (28)delay(60000); (28)trailler(6000); (28)delay(60000); (28)} (28)void flash_2() (28){ (28)uchar i; (28)for (i=129;i>0;i--) (28){ (28)cirp(i-2,0,1); (28)delay(8000); (28)cirp(i-1,0,0); (28)} (28)delay(8000); (28)for (i=0;i<136;i++) (28){ (28)cirp(i-8,1,0); (29)} (29)delay(8000); (29)for (i=129;i>0;i--) (29){ (29)cirp(i-2,0,1); (29)delay(8000); (29)} (29)delay(8000); (29)for (i=0;i<128;i++) (29){ (29)cirp(i-8,1,0); (29)delay(8000); (29)} (29)delay(60000); (29)} (29)void flash_3() (29){ (29)char i; (29)for (i=0;i<8;i++) (29){ (29)box_apeak_xy(0,i,0,7,i,7,1,1); (29)delay(20000); (29)if (i<7) (29)box_apeak_xy(0,i,0,7,i,7,1,0); (29)} (29)for (i=7;i>=0;i--) (29){ (29)box_apeak_xy(0,i,0,7,i,7,1,1); (29)delay(20000); (29)if (i>0) (29)box_apeak_xy(0,i,0,7,i,7,1,0); (29)} (29)for (i=0;i<8;i++) (29){ (29)box_apeak_xy(0,i,0,7,i,7,1,1); (29)delay(20000); (29)if (i<7) (29)box_apeak_xy(0,i,0,7,i,7,1,0); (29)} (29)} (29)void flash_4() (29){ (30)an[j-7]=j; (30)for (i=0;i<=16;i++) (30){ (30)for (j=0;j<8;j++) (30){ (30)if ((an[j]<8)&(an[j]>=0)) (30)line(0,an[j],j,7,an[j],j,1); (30)} (30)for (j=0;j<8;j++) (30){ (30)if (((an[j]+1)<8)&(an[j]>=0)) (30)line(0,an[j]+1,j,7,an[j]+1,j,0); (30)} (30)for (j=0;j<8;j++) (30){ (30)if (an[j]>0) (30)an[j]--; (30)} (30)delay(15000); (30)} (30)for (j=0;j<8;j++) (30)an[j]=1-j; (30)for (i=0;i<=16;i++) (30){ (30)for (j=0;j<8;j++) (30){ (30)if ((an[j]<8)&(an[j]>=0)) (30)line(0,an[j],j,7,an[j],j,1); (30)} (30)for (j=0;j<8;j++) (30){ (30)if (((an[j]-1)<7)&(an[j]>0)) (30)line(0,an[j]-1,j,7,an[j]-1,j,0); (30)} (30)for (j=0;j<8;j++) (30){ (30)if (an[j]<7) (30)an[j]++; (30)} (30)delay(15000); (30)} (30)} (31)void flash_5() (31)char i=8,j,an[4]; (31)1 (31)for (j=7;j<11;j++) (31)an[j-7]=j; (31)while(i--) (31){ (31)for (j=0;j<4;j++) (31){ (31)if (an[j]<8) (31)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (31)if (an[j]<7) (31)box_apeak_xy(j,an[j]+1,j,7-j,an[j]+1,7-j,0,0); (31)} (31)for (j=0;j<4;j++) (31){ (31)if (an[j]>3) (31)an[j]--; (31)} (31)delay(a); (31)} (31)2 (31)i=3; (31)for (j=0;j<4;j++) (31)an[j]=5-j; (31)while(i--) (31){ (31)for (j=1;j<4;j++) (31){ (31)if (an[j]<4) (31)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (31)if (an[j]<3) (31)box_apeak_xy(j,an[j]+1,j,7-j,an[j]+1,7-j,0,0); (31)} (31)for (j=0;j<4;j++) (31){ (31)if (an[j]>0) (31)an[j]--; (31)} (31)delay(a); (31)} (32)3 (32)i=3; (32)for (j=1;j<4;j++) (32){ (32)for (j=1;j<4;j++) (32){ (32)if (an[j]>=0) (32)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (32)if (an[j]>0) (32)box_apeak_xy(j,an[j]-1,j,7-j,an[j]-1,7-j,0,0); (32)} (32)for (j=1;j<4;j++) (32){ (32)if (an[j]<3) (32)an[j]++; (32)} (32)delay(a); (32)} (32)4 (32)i=3; (32)for (j=0;j<4;j++) (32)an[j]=j+1; (32)while(i--) (32){ (32)for (j=1;j<4;j++) (32){ (32)if (an[j]>3) (32)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (32)if (an[j]>3) (32)box_apeak_xy(j,an[j]-1,j,7-j,an[j]-1,7-j,0,0); (32)} (32)for (j=0;j<4;j++) (32)an[j]++; (32)delay(a); (32)} (32)5 (32)i=3; (32)for (j=3;j<6;j++) (32)an[j-2]=j; (32)while(i--) (32){ (33)for (j=1;j<4;j++) (33){ (33)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (33)box_apeak_xy(j,an[j]+1,j,7-j,an[j]+1,7-j,0,0); (33)} (33)if (an[j]>3) (33)an[j]--; (33)} (33)delay(a); (33)} (33)6 (33)i=3; (33)for (j=0;j<4;j++) (33)an[j]=5-j; (33)while(i--) (33){ (33)for (j=1;j<4;j++) (33){ (33)if (an[j]<4) (33)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (33)if (an[j]<3) (33)box_apeak_xy(j,an[j]+1,j,7-j,an[j]+1,7-j,0,0); (33)} (33)for (j=0;j<4;j++) (33){ (33)if (an[j]>0) (33)an[j]--; (33)} (33)delay(a); (33)} (33)7 (33)i=3; (33)for (j=0;j<4;j++) (33)an[j]=3-j; (33)an[0]=2; (33)while(i--) (33){ (33)for (j=0;j<3;j++) (33){ (33)if (an[j]>=0) (33)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (34)if (an[j]>=0) (34)box_apeak_xy(j,an[j]+1,j,7-j,an[j]+1,7-j,0,0); (34)} (34)for (j=0;j<4;j++) (34){ (34)if (j<5-i) (34)an[j]--; (34)} (34)8 (34)i=10; (34)for (j=0;j<4;j++) (34)an[j]=j-2; (34)while(i--) (34){ (34)for (j=0;j<4;j++) (34){ (34)if (an[j]>=0) (34)box_apeak_xy(j,an[j],j,7-j,an[j],7-j,0,1); (34)if (an[j]>=0) (34)box_apeak_xy(j,an[j]-1,j,7-j,an[j]-1,7-j,0,0); (34)} (34)for (j=0;j<4;j++) (34){ (34)if (an[j]<7) (34)an[j]++; (34)} (34)delay(a); (34)} (34)} (34)void flash_6() (34){ (34)uchar i,j,k,z; (34)roll_apeak_yz(1,10000); (34)roll_apeak_yz(2,10000); (34)roll_apeak_yz(3,10000); (34)roll_apeak_yz(0,10000); (34)roll_apeak_yz(1,10000); (34)roll_apeak_yz(2,10000); (34)roll_apeak_yz(3,10000); (34)for (i=0;i<3;i++) (34){ (34)for (j=0;j<8;j++) (35){ (35)for (k=0;k<8;k++) (35){ (35)if ((table_3p[i][j]>>k)&1) (35){ (35)for (z=1;z<8;z++) (35){ (35)point (j,7-k,z,1); (35)delay(5000); (35)} (35)} (35)} (35)} (35)trans(7,15000); (35)} (35)} (35)void flash_7() (35){ (35)uchar i; (35)uint a=3000; (35)roll_apeak_yz(0,10000); (35)roll_apeak_yz(1,10000); (35)roll_apeak_yz(2,10000); (35)roll_apeak_yz(3,10000); (35)roll_apeak_yz(0,10000); (35)roll_apeak_yz(1,10000); (35)roll_apeak_yz(2,10000); (35)roll_apeak_yz(3,10000); (35)roll_apeak_yz(0,10000); (35)roll_apeak_yz(1,10000); (35)roll_apeak_yz(2,10000); (35)roll_apeak_xy(0,10000); (35)roll_apeak_xy(1,10000); (35)roll_apeak_xy(2,10000); (35)roll_apeak_xy(3,10000); (35)roll_apeak_xy(0,10000); (35)roll_apeak_xy(1,10000); (35)roll_apeak_xy(2,10000); (35)roll_apeak_xy(3,10000); (35)for (i=0;i<8;i++) (36){ (36)box_apeak_xy (0,i,0,7-i,i,7,1,1); (36)delay(a); (36)} (36)delay(30000); (36)roll_3_xy(0,a); (36)delay(30000); (36)roll_3_xy(1,a); (36)delay(30000); (36)roll_3_xy(2,a); (36)delay(30000); (36)roll_3_xy(0,a); (36)delay(30000); (36)roll_3_xy(1,a); (36)delay(30000); (36)roll_3_xy(2,a); (36)delay(30000); (36)roll_3_xy(3,a); (36)for (i=7;i>0;i--) (36){ (36)box_apeak_xy(i,0,0,i,7,7,1,0); (36)delay(a); (36)} (36)} (36)void flash_8() (36){ (36)uchar i; (36)for (i=5;i<8;i++) (36){ (36)tranoutchar(i,10000); (36)delay(60000); (36)delay(60000); (36)} (36)} (36)void flash_9() (36){ (36)char i; (36)uchar j,an[8],x,y,t,x1,y1; (36)for (i=0;i<8;i++) (36){ (36)box_apeak_xy (i,0,0,i,7,7,1,1); (36)if (i) (37)box_apeak_xy (i-1,0,0,i-1,7,7,1,0); (37)delay(10000); (37)} (37)roll_apeak_xy(3,10000); (37)roll_apeak_xy(0,10000); (37)roll_apeak_xy(1,10000); (37)for (i=0;i<7;i++) (37){ (37)line(6-i,6-i,0,6-i,6-i,7,1); (37)line(i,7,0,i,7,7,0); (37)delay(10000); (37)} (37)for (i=0;i<85;i++) (37){ (37)clear(0); (37)for (j=0;j<8;j++) (37){ (37)t=an[j]%28; (37)x=dat2[t]>>5; (37)y=(dat2[t]>>2)&0x07; (37)t=(an[j]-14)%28; (37)x1=dat2[t]>>5; (37)y1=(dat2[t]>>2)&0x07; (37)line(x,y,j,x1,y1,j,1); (37)} (37)for (j=0;j<8;j++) (37){ (37)if ((i>j)&(j>i-71)) (37)an[j]++; (37)} (37)delay(5000); (37)} (37)for (i=0;i<85;i++) (37){ (37)clear(0); (37)for (j=0;j<8;j++) (37){ (37)t=an[j]%28; (37)x=dat2[t]>>5; (37)y=(dat2[t]>>2)&0x07; (37)t=(an[j]-14)%28; (38)x1=dat2[t]>>5; (38)y1=(dat2[t]>>2)&0x07; (38)line(x,y,j,x1,y1,j,1); (38)} (38)for (j=0;j<8;j++) (38){ (38)if ((i>j)&(j>i-71)) (38)an[j]--; (38)} (38)delay(5000); (38)} (38)for (i=0;i<29;i++) (38){ (38)clear(0); (38)y=(dat2[t]>>2)&0x07; (38)t=(an[0]-14)%28; (38)x1=dat2[t]>>5; (38)y1=(dat2[t]>>2)&0x07; (38)box_apeak_xy(x,y,0,x1,y1,7,0,1); (38)box_apeak_xy(x,y,1,x1,y1,6,0,1); (38)an[0]++; (38)delay(5000); (38)} (38)for (i=0;i<16;i++) (38){ (38)clear(0); (38)t=an[0]%28; (38)x=dat2[t]>>5; (38)y=(dat2[t]>>2)&0x07; (38)t=(an[0]-14)%28; (38)x1=dat2[t]>>5; (38)y1=(dat2[t]>>2)&0x07; (38)box_apeak_xy(x,y,0,x1,y1,7,1,1); (38)an[0]--; (38)delay(5000); (38)} (38)for (i=0;i<8;i++) (38){ (38)line(i,i,0,0,0,i,0); (38)delay(5000); (39)} (39)for (i=1;i<7;i++) (39){ (39)line(i,i,7,7,7,i,0); (39)delay(5000); (39)} (39)for (i=1;i<8;i++) (39){ (39)clear(0); (39)box(7,7,7,7-i,7-i,7-i,0,1); (39)delay(10000); (39)} (39)for (i=1;i<7;i++) (39){ (39)clear(0); (39)box(0,0,0,7-i,7-i,7-i,0,1); (39)delay(10000); (39){ (39)clear(0); (39)box(0,0,0,i,i,i,0,1); (39)delay(10000); (39)} (39)for (i=1;i<7;i++) (39){ (39)clear(0); (39)box(7,0,0,i,7-i,7-i,0,1); (39)delay(10000); (39)} (39)for (i=1;i<8;i++) (39){ (39)box(7,0,0,7-i,i,i,1,1); (39)delay(10000); (39)} (39)for (i=1;i<7;i++) (39){ (39)clear(0); (39)box(0,7,7,7-i,i,i,1,1); (39)delay(10000); (39)} (39)} (39)void flash_10() (40){ (40)uchar i,j,an[4],x,y,t; (40)for (i=1;i<7;i++) (40){ (40)clear(0); (40)box(0,6,6,1,7,7,1,1); (40)box(i,6,6-i,i+1,7,7-i,1,1); (40)box(i,6,6,i+1,7,7,1,1); (40)box(0,6,6-i,1,7,7-i,1,1); (40)box(0,6-i,6,1,7-i,7,1,1); (40)box(i,6-i,6-i,i+1,7-i,7-i,1,1); (40)box(i,6-i,6,i+1,7-i,7,1,1); (40)box(0,6-i,6-i,1,7-i,7-i,1,1); (40)delay(30000); (40)} (40)for (i=0;i<4;i++) (40){ (40)an[i]=6*i; (40)} (40)clear(0); (40)for(j=0;j<4;j++) (40){ (40)t=an[j]%24; (40)x=dat3[t]>>4; (40)y=dat3[t]&0x0f; (40)box(x,y,0,x+1,y+1,1,1,1); (40)box(x,y,6,x+1,y+1,7,1,1); (40)} (40)for (j=0;j<4;j++) (40)an[j]++; (40)delay(10000); (40)} (40)for (i=0;i<35;i++) (40){ (40)clear(0); (40)for(j=0;j<4;j++) (40){ (40)t=an[j]%24; (40)x=dat3[t]>>4; (40)y=dat3[t]&0x0f; (40)box(x,y,0,x+1,y+1,1,1,1); (41)box(x,y,6,x+1,y+1,7,1,1); (41)} (41)for (j=0;j<4;j++) (41)an[j]--; (41)delay(10000); (41)} (41)for (i=0;i<35;i++) (41){ (41)clear(0); (41)for(j=0;j<4;j++) (41){ (41)t=an[j]%24; (41)x=dat3[t]>>4; (41)y=dat3[t]&0x0f; (41)box(x,0,y,x+1,1,y+1,1,1); (41)box(x,6,y,x+1,7,y+1,1,1); (41)} (41)for (j=0;j<4;j++) (41)an[j]++; (41)delay(10000); (41)} (41)clear(0); (41)for(j=0;j<4;j++) (41){ (41)t=an[j]%24; (41)x=dat3[t]>>4; (41)y=dat3[t]&0x0f; (41)box(x,0,y,x+1,1,y+1,1,1); (41)box(x,6,y,x+1,7,y+1,1,1); (41)} (41)for (j=0;j<4;j++) (41)an[j]--; (41)delay(10000); (41)} (41)for (i=6;i>0;i--) (41){ (41)clear(0); (41)box(0,6,6,1,7,7,1,1); (41)box(i,6,6-i,i+1,7,7-i,1,1); (41)box(i,6,6,i+1,7,7,1,1); (42)box(0,6,6-i,1,7,7-i,1,1); (42)box(0,6-i,6,1,7-i,7,1,1); (42)box(i,6-i,6-i,i+1,7-i,7-i,1,1); (42)box(i,6-i,6,i+1,7-i,7,1,1); (42)box(0,6-i,6-i,1,7-i,7-i,1,1); (42)delay(30000); (42)} (42)} (42)void flash_11() (42){ (42)uchar i,j,t,x,y; (42)uchar code daa[13]={0,1,2,0x23,5,6,7,6,5,0x23,2,1,0}; (42)for (j=0;j<5;j++) (42){ (42)for (i=0;i<13;i++) (42){ (42)if (daa[i]>>4) (42){ (42)t=daa[i]&0x0f; (42)line (0,0,t+1,0,7,t+1,1); (42)} (42)else (42)t=daa[i]; (42)line (0,0,t,0,7,t,1); (42)} (42)} (42)for (j=1;j<8;j++) (42){ (42)if (j>3) (42)t=4; (42)else (42)t=j; (42)for (i=0;i<24;i+=j) (42){ (42)x=dat3[i]>>4; (42)y=dat3[i]&0x0f; (42)box_apeak_xy(0,x,y,0,x+1,y+1,1,1); (42)transss(); (42)delay(10000); (42)} (42)} (42)for (j=1;j<8;j++) (43){ (43)if (j>3) (43)t=4; (43)else (43)t=j; (43)for (i=0;i<24;i+=j) (43){ (43)x=dat3[i]>>4; (43)y=dat3[i]&0x0f; (43)point (0,x,y,1); (43)transss(); (43)delay(10000); (43)} (43)} (43)} (43)void _P3(uchar x) (43){ (43)p30 = x&0x01; (43)p31 = (x&0x02)>>1; (43)p32 = (x&0x04)>>2; (43)p33 = (x&0x08)>>3; (43)p34 = (x&0x10)>>4; (43)p35 = (x&0x20)>>5; (43)p36 = (x&0x40)>>6; (43)p37 = (x&0x80)>>7; (43){ (43)sinter(); (43)while(1){ (43)clear(0); (43)/*play list*/ (43)flash_1(); (43)clear(0); (43)flash_2(); (43)flash_3(); (43)flash_4(); (43)flash_4(); (43)flash_5(); (43)flash_5(); (43)flash_6(); (43)flash_7(); (43)flash_8(); (43)flash_9(); (43)flash_10(); (43)clear (0); (43)flash_11(); (43)flash_9(); (43)flash_5(); (43)flash_7(); (44)flash_5(); (44)flash_6(); (44)flash_8(); (44)flash_9(); (44)flash_10(); (44)} (44)} (44)P0; 573 in (44)P1; uln2803 (44)P2; 573 LE (44)void print() interrupt 1 (44){ (44)uchar i; (44)static uchar layer=0; (44)P1=0; (44)for (i=0;i<8;i++) (44){ (44)P2=1<<i; (44)delay(3); (44)P0=display[layer][i]; (44)P1=1<<layer; (44)if (layer<7) (44)layer++; (44)else (44)layer=0; (44)TH0=0xc0; (44)TL0=0; (44)} (44)P0; 573 in p2 (44)P1; uln2803 p0 (44)P2; 573 LE p1 (44)void print() interrupt 1 (44){ (44)uchar i; (44)static uchar layer=0; (44)_P3(0); (44)for (i=0;i<8;i++) (44){ (44)P2=1<<i; (44)delay(3); (44)P0=display[layer][i]; (44)delay(3); (44)} (45)_P3(1<<layer); (45)if (layer<7) (45)layer++; (45)else (45)layer=0; (45)TH0=0xc0; (45)TL0=0; (45)} (45)void print() interrupt 1 (45){ (45)uchar i; (45)static uchar layer=0; (45)P0=0; (45)P1=0x00; (45)for (i=0;i<8;i++) (45){ (45)P1=0x00; (45)P2=display[layer][i]; (45)delay(3); (45)P1=1<<i;_crol_(0xfe,i) ; (45)。
3d8光立方程序
/*railway 3*/
uchar code dat3[24]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x16,0x26,0x36,0x46,0x56,0x66,0x0x60,0x50,0x40,0x30,0x20,0x10};
EX1=1;
EA=1;
}
void delay5us(void) //误差 -0.026765046296us STC 1T 22.1184Mhz
{
unsigned char a,b;
for(b=7;b>0;b--)
for(a=2;a>0;a--);
/*3p char*/
uchar code table_3p[3][8]={0xff,0x89,0xf5,0x93,0x93,0xf5,0x89,0xff,0x0e,0x1f,0x3f,0x7e,0x7e,0x3f,0x1f,0x0e,0x18,0x3c,0x7e,0xff,0x18,0x18,0x18,0x18};
/*initializtion
That is to initialize the program .
It is write to set the timer in c52 mcu.
So the program can renovate the led_3d_cube in fixed time use the interrupt function.*/
display[j][i]=display[j][i+1];
}
if (i<4)
{
for (j=0;j<8;j++)
uchar i,j;
光立方红外遥控程序源码
/**********************************************黎明途电子*********************************************************** *//**********************************************红外遥控器测试程序*******************************************//*拨轮按键左显示心形拨轮按键中全亮显示拨轮按键右单层向上动态*/#include <STC12C5A60S2.H>#define uchar unsigned char#define uint unsigned intchar data menu,out,amenu,bb,num,cheng; //menu按键左,out按键右, amenu按键中, bb延时变量, num频谱显示,cheng行扫描变量,uchar data buffer[8]; //光立方显示一层的数据暂存数组/*定义管脚定义单片机用于发送数据给74HC595引脚和数据移位控制*/sbit SH_CP = P3^4; //SCKsbit ST_CP = P3^3;//RCKsbit DS = P3^5;//SERsbit CH340 = P0^3;//SEsbit SH_CP2 = P2^6; //SCK2sbit ST_CP2 = P2^5;//RCK2sbit DS2 = P2^3;//SER2sbit RR=P3^6;//红sbit GG=P2^2;//绿sbit BB=P2^4;//蓝sbit ABL=P4^3;//亮度sbit k1=P0^4;//播放、暂停sbit k2=P0^5;//音量减sbit k3=P0^6;//音量加bit receive_sta=0; //接受状态,表示数据是否接受完成sbit IRIN = P3^2; //红外接收器数据线void IRdelay(char x); //x*0.14MSunsigned char IRCOM[7];/********************************************************** *********//********************************************************** *********************************************************** *****************/uchar code display1[8][8]={ //图形1 全亮模式0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第1层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第2层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第4层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第5层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第6层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第7层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第8层};uchar code display2[8][8]={ //图形2 心形模式0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第1层0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第2层0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第3层0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第4层0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第5层0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第6层0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第7层0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第8层};uchar code display3[8][8]={ //图形3 每次亮一层动态模式0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第1层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第2层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第3层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第5层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第6层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第7层0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//第8层};/*--------------- 初始化 --------------*/ void timer0init(void){TMOD=0X12;EX0=1;ET0=1;EX1=0;ET1=1;//定时器1开中断EA=1;TH1=0xc0;TL1=0;IPH|=0X01;PX0=1;IT0=1;P1M0=0X7F;P1M1=0X80;P0M0=0xf8; //P0口开漏输出P0M1=0xf0;P3M0=0x00; //P3口准双向输出P3M1=0X00;P2M0=0x00; //P2口准双向输出P2M1=0X00;}void initial595() //列驱动初始化{SH_CP = 0;ST_CP = 0;DS = 0;}void initial5952() //行驱动初始化{SH_CP2 = 0;ST_CP2 = 0;DS2 = 0;}/************************************延时函数*********************************************************** ***/void IRdelay(unsigned char x)//延时子程序{unsigned char a,b;while(x--){for(b=6;b>0;b--)for(a=127;a>0;a--);}}//cheng 行扫描变量,yanse颜色控制, liangdu亮度控制void delay(uint i){char b;while (i--){b=bb;while(b--);}}void delay2(uint t){int i;while(t--)for(i=0;i<5;i++);}/************************************ 发送数据*********************************************************** ****/void send_data(unsigned char d)//发送一层当中的一行显示数据,8位{unsigned char i;for(i=0;i<8;i++){DS = d&0x80;//发送最低位SH_CP = 1;SH_CP = 0; //移位寄存器移位d = d<<1; //数据移位f}}void xiansi1() //一次发送1层,8行的显示数据,64位{send_data(buffer[0]); //u9send_data(buffer[1]); //u8send_data(buffer[2]); //u7send_data(buffer[3]); //u6send_data(buffer[4]); //u5send_data(buffer[5]); //u4send_data(buffer[6]); //u3send_data(buffer[7]); //u2}/*************************************************主函数*********************************************************** ********/void main(){uchar d,dd,i,j,cheng;timer0init();initial595();initial5952();ABL=0;menu=1;out=0;bb=0;RR=1; //红色控制GG=1; //绿色控制BB=0; //蓝色控制d=60000;dd=60000;while(menu==1) //显示全亮{static uchar layer=0;for(j=0;j<8;j++) //LED正极驱动循环扫描8层 {for (i=0;i<8;i++) //循环8次,每一次将光立方的一层动画数据装入buffer[]数组{buffer[i]=display1[layer][i]; //调用层暂存数组将用于光立方显示的二维数组里的一层显示数据装入其中}xiansi1(); //单片机发送数据给74HC595cheng=0x01<<layer; //行移位,DS2 = ~cheng&0x01; //发送层扫描数据SH_CP2 = 1;SH_CP2 = 0; //移位寄存器移位ST_CP=1;ST_CP=0; //控制显示列ST_CP2=1;ST_CP2=0; //控制显示层if (layer<7)layer++; //为扫面上一层做准备(光立方一个静止图形是从最底层开始扫描)elselayer=0;delay(2);}}while(amenu==1) //显示心形{static uchar layer=0;for(j=0;j<8;j++) //LED正极驱动循环扫描8层{for (i=0;i<8;i++) //循环8次,每一次将光立方的一层动画数据装入buffer[]数组{buffer[i]=~display2[layer][i]; //调用层暂存数组将用于光立方显示的二维数组里的一层显示数据装入其中}xiansi1(); //单片机发送数据给74HC595cheng=0x01<<layer; //行移位,DS2 = ~cheng&0x01; //发送层扫描数据SH_CP2 = 1;SH_CP2 = 0; //移位寄存器移位ST_CP=1;ST_CP=0; //控制显示列ST_CP2=1;ST_CP2=0; //控制显示层if (layer<7)layer++; //为扫面上一层做准备(光立方一个静止图形是从最底层开始扫描)elselayer=0;delay(2);}}while(out==1) //一层一层的动态显示{static uchar layer=0;for(j=0;j<8;j++) //LED正极驱动循环扫描8层 {for (i=0;i<8;i++) //循环8次,每一次将光立方的一层动画数据装入buffer[]数组{buffer[i]=display3[layer][i]; //调用层暂存数组将用于光立方显示的二维数组里的一层显示数据装入其中}xiansi1(); //单片机发送数据给74HC595cheng=0x01<<layer; //行移位,DS2 = ~cheng&0x01; //发送层扫描数据SH_CP2 = 1;SH_CP2 = 0; //移位寄存器移位ST_CP=1;ST_CP=0; //控制显示列ST_CP2=1;ST_CP2=0; //控制显示层if (layer<7)layer++; //为扫面上一层做准备(光立方一个静止图形是从最底层开始扫描)elselayer=0;if(out==0){break;}delay(65535);delay(65535);delay(65535);delay(65535);}}}void IR_IN(void) interrupt 0{unsigned char j,k,N=0;EX0 = 0;IRdelay(15);if (IRIN==1){ EX0 =1;return;}//确认IR信号出现while (!IRIN) //等IR变为高电平,跳过9ms的前导低电平信号。
光立方的工作原理_基于74hc573的8-8-8光立方LED的控制方式
光立方的工作原理_基于74hc573的8*8*8光立方LED的控制方式光立方由若干个二极管led灯以立方体形式搭建,4*4*4、8*8*8、16*16*16甚至更多,又由单片机、锁存器、译码器等电器元件驱动,形成立体动画效果。
其中8*8*8光立方最为常见。
例如:8*8*8光立方是由512个发光二极管按照立方体的方式搭建焊接起来的,有层共阴束共阳和层共阳束共阴两种方案,每一层有8*8个发光二极管,共8层。
用c语言编译单片机程序使自定义动画效果得以实现。
光立方工作原理光立方简单讲就是用单片机控制很多规则排列的LED的亮和灭。
1、单个LED的控制方式先了解单个LED的控制方式,可以是将正极接电源,负极通过一个限流电阻连接至单片机的某个IO口。
IO口输出低电平时,LED就亮,反之,LED灭。
如果我们想驱动任意位置的led,我们只需要在该位置led所使用的列线接地,行线接上+V 即可。
学过单片机的朋友们,都知道数码管是怎么点亮的,其中有位选和段选之分,通过扫描来实现所有数码管能正常工作以实现显示我们想要的数字。
点阵也一样,尽管是8*8的点阵,如果我们让整体能随意显示图案,那也需要用扫描的方式才能够实现,否则,无法实现对其精准的控制。
所谓扫描,就是说,我们一次只能让一行排或者一竖排的灯亮。
每次只能这么点,8次为一个周期,从左至右依次点一次,那么循环起来,我们看到的就是完整的图像了。
2、每一层LED的控制方式若按照单个LED的控制方式,每个LED需要占用单片机的一个IO口,控制100个LED 就需要100个IO口。
那么,有没有一种方式,可以用较少的IO口,控制较多的LED呢?答案是肯定的,这种方法,就是扫描驱动电路。
光立方(含程序)毕业设计
毕业设计(论文)原创性声明和使用授权说明原创性声明本人郑重承诺:所呈交的毕业设计(论文),是我个人在指导教师的指导下进行的研究工作及取得的成果。
尽我所知,除文中特别加以标注和致谢的地方外,不包含其他人或组织已经发表或公布过的研究成果,也不包含我为获得及其它教育机构的学位或学历而使用过的材料。
对本研究提供过帮助和做出过贡献的个人或集体,均已在文中作了明确的说明并表示了谢意。
作者签名:日期:指导教师签名:日期:使用授权说明本人完全了解大学关于收集、保存、使用毕业设计(论文)的规定,即:按照学校要求提交毕业设计(论文)的印刷本和电子版本;学校有权保存毕业设计(论文)的印刷本和电子版,并提供目录检索与阅览服务;学校可以采用影印、缩印、数字化或其它复制手段保存论文;在不以赢利为目的前提下,学校可以公布论文的部分或全部内容。
作者签名:日期:学位论文原创性声明本人郑重声明:所呈交的论文是本人在导师的指导下独立进行研究所取得的研究成果。
除了文中特别加以标注引用的内容外,本论文不包含任何其他个人或集体已经发表或撰写的成果作品。
对本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。
本人完全意识到本声明的法律后果由本人承担。
作者签名:日期:年月日学位论文版权使用授权书本学位论文作者完全了解学校有关保留、使用学位论文的规定,同意学校保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。
本人授权大学可以将本学位论文的全部或部分内容编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
涉密论文按学校规定处理。
作者签名:日期:年月日导师签名:日期:年月日注意事项1.设计(论文)的内容包括:1)封面(按教务处制定的标准封面格式制作)2)原创性声明3)中文摘要(300字左右)、关键词4)外文摘要、关键词5)目次页(附件不统一编入)6)论文主体部分:引言(或绪论)、正文、结论7)参考文献8)致谢9)附录(对论文支持必要时)2.论文字数要求:理工类设计(论文)正文字数不少于1万字(不包括图纸、程序清单等),文科类论文正文字数不少于1.2万字。
888光立方电路原理
888光立方电路原理光立方电路是一种基于光学技术的新型电路结构,在信息传输和处理领域具有广泛的应用前景。
其中,888光立方电路是一种具有特殊结构和功能的光立方电路,下面将对其原理进行详细介绍。
一、光立方电路的基本原理光立方电路是通过利用光学元件和光学信号处理技术实现信息传输和处理的一种新型电路结构。
与传统的电子电路相比,光立方电路具有更高的传输速度、更低的能耗和更大的容量。
它利用光学器件将电信号转换为光信号,并通过光学光纤进行传输,最后再将光信号转换为电信号进行处理。
二、888光立方电路的特点888光立方电路是一种特殊的光立方电路,其特点主要体现在以下几个方面:1. 多通道传输:888光立方电路具有多个通道,可以同时传输多个信息信号,大大提高了传输效率和容量。
2. 高速传输:由于光信号的传输速度远远高于电信号,888光立方电路可以实现超高速的数据传输,满足了现代信息处理的需求。
3. 低能耗:光立方电路采用的是光学信号传输和处理技术,相比传统的电子电路,其能耗更低,可以有效降低能源消耗。
4. 高可靠性:光立方电路具有较高的抗干扰能力和抗衰减能力,能够在复杂的环境中保持传输信号的稳定性和可靠性。
5. 灵活可扩展:888光立方电路可以根据需求进行灵活的扩展和组合,以适应不同规模和复杂度的信息处理任务。
三、888光立方电路的工作原理888光立方电路的工作原理主要包括以下几个步骤:1. 信号输入:将电信号输入到光立方电路中,经过信号处理模块进行处理和调整,以适应光信号的传输和处理要求。
2. 光信号转换:经过信号处理模块处理后的电信号被转换为光信号,通过光学器件将光信号发射到光纤中进行传输。
3. 光信号传输:光信号在光纤中传输,通过光纤的全内反射实现信号的传输和传导。
4. 光信号转换:光信号到达目标位置后,再次通过光学器件将光信号转换为电信号。
5. 信号输出:经过光信号转换后的电信号通过信号处理模块进行进一步处理和调整,最后输出到目标设备或系统。
光立方源代码
#include <reg52.h>#include <intrins.h>#include <string.h>#include <Binary.h>#define uint unsigned int#define uchar unsigned char#define LED P0#define FLOOR P2uchar code table[16]={B0000,B0000,B0000,B0000, //层1B0000,B0000,B0000,B0000, //层2B0000,B0000,B0000,B0000, //层3B0000,B0000,B0000,B0000, //层4};void delay(uint xms){uint i,j;for(i = xms ; i > 0 ; i--)for(j=150;j > 0;j--);}void Cube_display(uchar array[],uint delay_time){uchar floor_temp;uchar num;for(;delay_time > 0;delay_time--){for(num = 0,floor_temp = 0x01;num < 8;num++) {FLOOR = ~floor_temp;LED = (~array[num]) | 0xf0;delay(1);LED = 0xff;floor_temp = floor_temp << 1; }for(num = 8,floor_temp = 0x01;num < 16;num++) {FLOOR = ~floor_temp;LED = (~(array[num]) << 4) | 0x0f;delay(1);LED = 0xff;floor_temp = floor_temp << 1;}}}void clr_display(uchar array[]){uint array_num;for(array_num = 0;array_num < 16;array_num++){array[array_num] = B0000;}}void main(void){uchar display_table[16];uint i1;uint i2;uint i3;uint table_num;uint table_num2;strcpy(display_table,table);while(1){//图像1开始display_table[12]=B1111;display_table[13]=B1111;display_table[14]=B1111;display_table[15]=B1111;Cube_display(display_table,6);for(table_num = 12;table_num > 0;table_num = table_num-4) {for(i1=1;i1<=7;i1++){table_num2 = table_num-4;if(i1>=1){display_table[table_num]=(display_table[table_num]<<1);display_table[table_num2]= ~((~display_table[table_num2]) << 1);}if(i1>=2){display_table[table_num+1]=(display_table[table_num+1]<<1);display_table[table_num2+1]= ~((~display_table[table_num2+1]) << 1); }if(i1>=3){display_table[table_num+2]=(display_table[table_num+2]<<1);display_table[table_num2+2]= ~((~display_table[table_num2+2]) << 1); }if(i1>=4){display_table[table_num+3]=(display_table[table_num+3]<<1);display_table[table_num2+3]= ~((~display_table[table_num2+3]) << 1); }Cube_display(display_table,6);}}display_table[7] = B1111;display_table[3] = B0000;Cube_display(display_table,5);display_table[6] = B1111;display_table[2] = B0000;display_table[11] = B1111;display_table[7] = B0000;Cube_display(display_table,7);for(i2 = 0;i2 <=5;i2++){clr_display(display_table);display_table[0] = B1111;display_table[5] = B1111;display_table[10] = B1111;display_table[15] = B1111;Cube_display(display_table,8);clr_display(display_table);display_table[4] = B1111;display_table[9] = B1111;display_table[14] = B1111;display_table[11] = B1111;Cube_display(display_table,8);clr_display(display_table);display_table[8] = B1111;display_table[13] = B1111;display_table[10] = B1111;display_table[7] = B1111;Cube_display(display_table,8);clr_display(display_table);display_table[2] = B1111;display_table[9] = B1111;display_table[3] = B1111;display_table[6] = B1111;Cube_display(display_table,8);clr_display(display_table);display_table[7] = B1111;display_table[2] = B1111;display_table[5] = B1111;display_table[8] = B1111;Cube_display(display_table,7);clr_display(display_table);display_table[4] = B1111;display_table[1] = B1111;display_table[6] = B1111;display_table[11] = B1111;Cube_display(display_table,8);}clr_display(display_table);display_table[0] = B1111;display_table[5] = B1111;display_table[10] = B1111;display_table[15] = B1111;Cube_display(display_table,8);//图像1jiefor(i2 = 0 ,i1 = 0x0f;i2 < 3 ;i2++){display_table[0] = B1111 & i1;display_table[5] = B1111 & i1;display_table[10] = B1111 & i1;display_table[15] = B1111 & i1;Cube_display(display_table,10);i1 = i1 >> 1;}display_table[0] = B0001;display_table[5] = B0001;display_table[10] = B0001;display_table[15] = B0001;Cube_display(display_table,9);for(i3 = 0;i3 < 5;i3++){for(i2 = 0 ,i1 = 0x01;i2 < 3 ;i2++) {display_table[0] = i1;display_table[5] = i1;display_table[10] = i1;display_table[15] = i1;Cube_display(display_table,7); i1 = i1 << 1;}for(i2 = 0 ,i1 = 0x08;i2 < 3 ;i2++){display_table[0] = i1;display_table[5] = i1;display_table[10] = i1;display_table[15] = i1;Cube_display(display_table,7);i1 = i1 >> 1;}}display_table[0] = B0001;display_table[5] = B0001;display_table[10] = B0001;display_table[15] = B0001;Cube_display(display_table,7);display_table[0] = B0000;Cube_display(display_table,22);display_table[5] = B0000;Cube_display(display_table,22);display_table[10] = B0000;Cube_display(display_table,22);for(i1 = 0 ;i1 < 4;i1++){display_table[15] = B0000;Cube_display(display_table,6);display_table[15] = B0001;Cube_display(display_table,6);}display_table[15] = B0000;Cube_display(display_table,4);for(i1 = 0 ;i1 < 16;i1++){display_table[15] = display_table[15] + 0x01; Cube_display(display_table,6);}for(i1 = 0 ;i1 < 4;i1++){display_table[15] = B0000;Cube_display(display_table,6);display_table[15] = B1111;Cube_display(display_table,6);}for(table_num = 15 ;table_num > 11;table_num--) {display_table[table_num] = B1111;Cube_display(display_table,7);}for(table_num = 8;table_num < 12;table_num++) {display_table[table_num] = B1111;Cube_display(display_table,7);}for(table_num = 7 ;table_num > 3;table_num--) {display_table[table_num] = B1111;Cube_display(display_table,7);}for(table_num = 0;table_num < 4;table_num++) {display_table[table_num] = B1111;Cube_display(display_table,7);}for(i1 = 0 ;i1 < 3;i1++){Cube_display(table,5);Cube_display(display_table,7);}//图形3for(table_num = 15 ;table_num > 11;table_num--) {display_table[table_num] = B0000;Cube_display(display_table,7);}for(table_num = 8;table_num < 12;table_num++) {display_table[table_num] = B0000;Cube_display(display_table,7);}for(table_num = 7 ;table_num > 3;table_num--) {display_table[table_num] = B0000;Cube_display(display_table,7);}for(table_num = 1;table_num < 4;table_num++) {display_table[table_num] = B0000;Cube_display(display_table,7);}for(i1 = 0 ;i1 < 3;i1 ++){display_table[0] = B1110;display_table[1] = B1110;display_table[2] = B1110;display_table[3] = B1110;display_table[4] = B0001;display_table[5] = B0001;display_table[6] = B0001;display_table[7] = B0001;;Cube_display(display_table,7);display_table[0] = B1100;display_table[1] = B1100;display_table[2] = B1100;display_table[3] = B1100;display_table[4] = B0010;display_table[5] = B0010;display_table[7] = B0010;display_table[8] = B0001;display_table[9] = B0001;display_table[10] = B0001;display_table[11] = B0001;Cube_display(display_table,7);display_table[0] = B1000;display_table[1] = B1000;display_table[2] = B1000;display_table[3] = B1000;display_table[4] = B0100;display_table[5] = B0100;display_table[6] = B0100;display_table[7] = B0100;display_table[8] = B0010;display_table[9] = B0010;display_table[10] = B0010;display_table[11] = B0010;display_table[12] = B0001;display_table[13] = B0001;display_table[14] = B0001;display_table[15] = B0001;Cube_display(display_table,7);display_table[12] = B0010;display_table[13] = B0010;display_table[14] = B0010;display_table[15] = B0010;display_table[8] = B0100;display_table[9] = B0100;display_table[10] = B0100;display_table[11] = B0100;display_table[4] = B1000;display_table[5] = B1000;display_table[6] = B1000;display_table[0] = B1000;display_table[1] = B1000;display_table[2] = B1000;display_table[3] = B1000; Cube_display(display_table,7);display_table[12] = B0100;display_table[13] = B0100;display_table[14] = B0100;display_table[15] = B0100;display_table[8] = B1000;display_table[9] = B1000;display_table[10] = B1000;display_table[11] = B1000;display_table[4] = B1000;display_table[5] = B1000;display_table[6] = B1000;display_table[7] = B1000;display_table[0] = B1000;display_table[1] = B1000;display_table[2] = B1000;display_table[3] = B1000;Cube_display(display_table,7);display_table[12] = B1000;display_table[13] = B1000;display_table[14] = B1000;display_table[15] = B1000;display_table[8] = B1000;display_table[9] = B1000;display_table[10] = B1000;display_table[11] = B1000;display_table[4] = B1000;display_table[5] = B1000;display_table[6] = B1000;display_table[7] = B1000;display_table[0] = B1000;display_table[1] = B1000;display_table[2] = B1000;display_table[3] = B1000;Cube_display(display_table,7);display_table[12] = B0100;display_table[13] = B0100;display_table[14] = B0100;display_table[15] = B0100;display_table[8] = B1000;display_table[9] = B1000;display_table[10] = B1000;display_table[11] = B1000;display_table[4] = B1000;display_table[5] = B1000;display_table[6] = B1000;display_table[7] = B1000;display_table[0] = B1000;display_table[1] = B1000;display_table[2] = B1000;display_table[3] = B1000;Cube_display(display_table,7);display_table[12] = B0010;display_table[13] = B0010;display_table[14] = B0010;display_table[15] = B0010;display_table[8] = B0100;display_table[9] = B0100;display_table[10] = B0100;display_table[11] = B0100;display_table[4] = B1000;display_table[5] = B1000;display_table[6] = B1000;display_table[7] = B1000;display_table[0] = B1000;display_table[1] = B1000;display_table[2] = B1000;display_table[3] = B1000;Cube_display(display_table,7);display_table[12] = B0001;display_table[13] = B0001;display_table[14] = B0001;display_table[15] = B0001;display_table[8] = B0010;display_table[9] = B0010;display_table[10] = B0010;display_table[11] = B0010;display_table[4] = B0100;display_table[5] = B0100;display_table[6] = B0100;display_table[7] = B0100;display_table[0] = B1000;display_table[1] = B1000;display_table[2] = B1000;display_table[3] = B1000;Cube_display(display_table,7);display_table[12] = B0000;display_table[13] = B0000;display_table[14] = B0000;display_table[15] = B0000;display_table[8] = B0001;display_table[9] = B0001;display_table[10] = B0001;display_table[11] = B0001;display_table[4] = B0010;display_table[5] = B0010;display_table[6] = B0010;display_table[7] = B0010;display_table[0] = B1100;display_table[1] = B1100;display_table[2] = B1100;display_table[3] = B1100;Cube_display(display_table,7);display_table[12] = B0000;display_table[13] = B0000;display_table[14] = B0000;display_table[15] = B0000;display_table[8] = B0000;display_table[9] = B0000;display_table[10] = B0000;display_table[11] = B0000;display_table[4] = B0001;display_table[5] = B0001;display_table[6] = B0001;display_table[7] = B0001;display_table[0] = B1110;display_table[1] = B1110;display_table[2] = B1110;display_table[3] = B1110;Cube_display(display_table,7);display_table[12] = B0000;display_table[13] = B0000;display_table[14] = B0000;display_table[15] = B0000;display_table[8] = B0000;display_table[9] = B0000;display_table[10] = B0000;display_table[11] = B0000;display_table[4] = B0000;display_table[5] = B0000;display_table[6] = B0000;display_table[7] = B0000;display_table[0] = B1111;display_table[1] = B1111;display_table[2] = B1111;display_table[3] = B1111;Cube_display(display_table,7);}for(i1 = 0;i1 < 4;i1 ++){display_table[12] = B0000;display_table[8] = B0000;display_table[4] = B1111;display_table[0] = B0000; Cube_display(display_table,7);display_table[12] = B0000;display_table[8] = B1111;display_table[4] = B0000;display_table[0] = B0000; Cube_display(display_table,7);display_table[12] = B1111;display_table[8] = B0000;display_table[4] = B0000;display_table[0] = B0000; Cube_display(display_table,7);display_table[12] = B0000;display_table[13] = B1111; Cube_display(display_table,7);display_table[13] = B0000;display_table[14] = B1111; Cube_display(display_table,7);display_table[14] = B0000;display_table[15] = B1111; Cube_display(display_table,7);display_table[15] = B0000;display_table[11] = B1111; Cube_display(display_table,7);display_table[11] = B0000;display_table[7] = B1111;Cube_display(display_table,7);display_table[7] = B0000;display_table[3] = B1111;Cube_display(display_table,7);display_table[3] = B0000;display_table[2] = B1111;Cube_display(display_table,7);display_table[2] = B0000;display_table[1] = B1111;Cube_display(display_table,7);display_table[1] = B0000;display_table[0] = B1111;Cube_display(display_table,7);}for(table_num = 1;table_num < 4;table_num++) {display_table[table_num] = B1111; Cube_display(display_table,7);}for(i1 = B1111 ;i1 <= B0000 ;i1--){display_table[0] = i1;Cube_display(display_table,7);}display_table[3] = B0000;Cube_display(display_table,4);display_table[0] = B0000;Cube_display(display_table,4);for(i1 = 0;i1<=5;i1++){display_table[5] = B1111;display_table[6] = B1111; Cube_display(display_table,9);display_table[9] = B1111;display_table[10] = B1111; Cube_display(display_table,9);display_table[13] = B1111;display_table[14] = B1111; Cube_display(display_table,9);display_table[13] = B0000;display_table[14] = B0000; Cube_display(display_table,7);display_table[9] = B0000;display_table[10] = B0000; Cube_display(display_table,7);display_table[5] = B0000;display_table[6] = B0000; Cube_display(display_table,7);display_table[5] = B1111;display_table[6] = B1111; Cube_display(display_table,5);display_table[9] = B1111;display_table[10] = B1111; Cube_display(display_table,5);display_table[13] = B1111;display_table[14] = B1111; Cube_display(display_table,5);}for(i1 = 0; i1 <=8; i1++){display_table[0]=B0001;display_table[1]=B0111;display_table[2]=B1110;display_table[3]=B1000;Cube_display(display_table,8);display_table[4]=B0001;display_table[5]=B0111;display_table[6]=B1110;display_table[7]=B1000;Cube_display(display_table,8);display_table[8]=B0001;display_table[9]=B0111;display_table[10]=B1110;display_table[11]=B1000;Cube_display(display_table,8);display_table[12]=B0001;display_table[13]=B0111;display_table[14]=B1110;display_table[15]=B1000;Cube_display(display_table,8);display_table[0]=B0011;display_table[1]=B0110;display_table[2]=B0110;display_table[3]=B1100;display_table[4]=B0011;display_table[5]=B0110;display_table[6]=B0110;display_table[7]=B1100;display_table[8]=B0011;display_table[9]=B0110;display_table[10]=B0110;display_table[11]=B1100;display_table[12]=B0011;display_table[13]=B0110;display_table[14]=B0110;display_table[15]=B1100;Cube_display(display_table,8);display_table[0]=B0110;display_table[1]=B0110;display_table[3]=B0110;display_table[4]=B0110;display_table[5]=B0110;display_table[6]=B0110;display_table[7]=B0110;display_table[8]=B0110;display_table[9]=B0110;display_table[10]=B0110;display_table[11]=B0110;display_table[12]=B0110;display_table[13]=B0110;display_table[14]=B0110;display_table[15]=B0110;Cube_display(display_table,8);display_table[0]=B1100;display_table[1]=B0110;display_table[2]=B0110;display_table[3]=B0011;display_table[4]=B1100;display_table[5]=B0110;display_table[6]=B0110;display_table[7]=B0011;display_table[8]=B1100;display_table[9]=B0110;display_table[10]=B0110;display_table[11]=B0011;display_table[12]=B1100;display_table[13]=B0110;display_table[14]=B0110;display_table[15]=B0011;Cube_display(display_table,8);display_table[1]=B1110;display_table[2]=B0111;display_table[3]=B0001;display_table[4]=B1000;display_table[5]=B1110;display_table[6]=B0111;display_table[7]=B0001;display_table[8]=B1000;display_table[9]=B1110;display_table[10]=B0111;display_table[11]=B0001;display_table[12]=B1000;display_table[13]=B1110;display_table[14]=B0111;display_table[15]=B0001;Cube_display(display_table,8);display_table[0]=B0000;display_table[1]=B1111;display_table[2]=B1111;display_table[3]=B0000;display_table[4]=B0000;display_table[5]=B1111;display_table[6]=B1111;display_table[7]=B0000;display_table[8]=B0000;display_table[9]=B1111;display_table[10]=B1111;display_table[11]=B0000;display_table[12]=B0000;display_table[13]=B1111;display_table[14]=B1111;display_table[15]=B0000;Cube_display(display_table,8); }clr_display(display_table);//图像1结束for(i1 = 0;i1<4;i1++){display_table[0]=B0100;display_table[1]=B0100;display_table[2]=B0100;display_table[3]=B0100;Cube_display(display_table,10);display_table[0]=B0010;display_table[1]=B0010;display_table[2]=B0010;display_table[3]=B0010;display_table[4]=B0100;display_table[5]=B0100;display_table[6]=B0100;display_table[7]=B0100;Cube_display(display_table,10);display_table[0]=B0001;display_table[1]=B0001;display_table[2]=B0001;display_table[3]=B0001;display_table[4]=B0010;display_table[5]=B0010;display_table[6]=B0010;display_table[7]=B0010;display_table[8]=B0100;display_table[9]=B0100;display_table[10]=B0100;display_table[11]=B0100;Cube_display(display_table,10);display_table[12]=B1100;display_table[13]=B1100;display_table[14]=B1100;display_table[8]=B0010;display_table[9]=B0010;display_table[10]=B0010;display_table[11]=B0010;display_table[4]=B0001;display_table[5]=B0001;display_table[6]=B0001;display_table[7]=B0001;display_table[0]=B0000;display_table[1]=B0000;display_table[2]=B0000;display_table[3]=B0000;Cube_display(display_table,10);display_table[12]=B1110;display_table[13]=B1110;display_table[14]=B1110;display_table[15]=B1110;display_table[8]=B0001;display_table[9]=B0001;display_table[10]=B0001;display_table[11]=B0001;display_table[4]=B0000;display_table[5]=B0000;display_table[6]=B0000;display_table[7]=B0000;Cube_display(display_table,10);display_table[12]=B1111;display_table[13]=B1111;display_table[14]=B1111;display_table[15]=B1111;display_table[8]=B0000;display_table[9]=B0000;display_table[10]=B0000;Cube_display(display_table,10); }}}。
8x8x8LED光立方原理加程序
8x8x8LED光立方周渴望南阳理工学院Q418084696功能;通过自定义代码实现LED炫丽动画效果。
通过按钮P3-7按钮实现动画与暂停。
底面是512个LED分成64组的共阳极由8个74hc573控制,每层64个LED 共阴极接在一起,共引出8跟负极与uln2803相连由其控制(这里注意uln280输出高电平LED负极通,低电平LED负极断)。
原理:先点亮最下层LED,假设8个74hc573全输出高电平,uln2803控制最下层输出高电平,那么最下层64个LED都点亮,延时10ms到5ms,关断最下层显示开通第二层假设也是8个74hc573全输出高电平,那么倒数第二层64个LED 全亮,再延时2ms到5ms那么以此类推每层的LED64个全都会亮,由于从第一层亮到最后一层亮时间小于50ms,由于人眼睛视觉暂留效果,就会觉得是全部层一起亮的,这样就“一起”点亮了512个LED。
其实每层的LED亮的数量不一样就组成了各种画面,通过调节定时器,就会有一种绚丽的动画效果。
本文使用的是STC12c5a60s2单片机,因为其程序存储空间大,stc89c52rc单片机完全可胜任(验证),只是程序太多要想办法了。
原理图:本试验中P0口控制8个74hc573的锁存端,P1控制每层与uln2803相连,P2口传输到74hc573数据。
本文使用动态扫苗,基于我之前做的16x16点阵文字移动显示程序,程序简单易懂,但是代码较多。
程序:#include <A T89X52.H>sbit LA0=P0^0; /*定义8个74hc573锁存脚*/ sbit LA1=P0^1;sbit LA2=P0^2;sbit LA3=P0^3;sbit LA4=P0^4;sbit LA5=P0^5;sbit LA6=P0^6;sbit LA7=P0^7;sbit KEY=P3^7; /*定义暂停开关*/void KEYKONG(); /*按钮程序*/unsigned char code ceng[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; /*8层控制代码每次亮一层*/unsigned char code di[1224][8]={{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}, /*动画代码,纵向扫描*/{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*3 1*/{0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38},{0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44},{0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04},{0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c},{0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04},{0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44},{0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*3 2*/{0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38},{0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44},{0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*3 3*/{0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00},{0x44,0x44,0x44,0x44,0x00,0x00,0x00,0x00},{0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00},{0x3c,0x3c,0x3c,0x3c,0x00,0x00,0x00,0x00},{0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00},{0x44,0x44,0x44,0x44,0x00,0x00,0x00,0x00},{0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*3 4*/{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*3 4*/ {0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*3 4*/ {0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*3 4*/ {0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c}, /*2 1*/ {0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20},{0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10},{0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08},{0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04},{0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04},{0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44},{0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38},{0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c}, /*2 2*/ {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44},{0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38},{0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00}, /*2 3*/ {0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00},{0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00},{0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00},{0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00},{0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00},{0x44,0x44,0x44,0x44,0x00,0x00,0x00,0x00},{0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00},{0x7c,0x7c,0x00,0x00,0x00,0x00,0x00,0x00}, /*2 4*/ {0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x7c,0x7c,0x00,0x00,0x00,0x00,0x00,0x00}, /*2 4*/ {0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x7c,0x7c,0x00,0x00,0x00,0x00,0x00,0x00}, /*2 4*/ {0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x7c,0x7c,0x00,0x00,0x00,0x00,0x00,0x00}, /*2 4*/ {0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00},{0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38}, /*1 1*/ {0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10},{0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10},{0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10},{0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10},{0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10},{0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30},{0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10},{0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38}, /*1 2*/ {0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00}, /*1 3*/ {0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00},{0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00},{0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00},{0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00},{0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00},{0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00},{0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00}, /*1 4*/ {0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00}, /*1 4*/ {0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00}, /*1 4*/ {0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00}, /*1 4*/ {0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00},{0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF}, /*再斜1*/ {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},{0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},{0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*再斜2*/ {0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00}, /*由左往右4*/ {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF}, /*再斜1*/{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},{0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},{0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*再斜2*/ {0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00}, /*由左往右4*/ {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF}, /*再斜1*/{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},{0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},{0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*再斜2*/ {0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00}, /*由左往右4*/ {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF}, /*再斜1*/{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},{0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00},{0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},{0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},{0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00},{0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, /*内斜1*/{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10}, /*竖一中面4*/ {0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*内斜2*/ {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, /*内斜1*/{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10}, /*竖一中面4*/ {0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*内斜2*/ {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, /*内斜1*/{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10}, /*竖一中面4*/{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*内斜2*/{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ /*43*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*扩展1*/{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, /*扩展2*/{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*扩展1*/{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ /*43*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*扩展1*/{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, /*扩展2*/{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*扩展1*/{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*横中面5*/ /*43*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*扩展1*/{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, /*扩展2*/{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下9*/{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下8*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下7*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下6*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40}, /*下5*/ {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40}, /*下4*/ {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10}, /*下3*/ {0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}, /*下2*/ {0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, /*下1*/ {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, /*下1*/ {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}, /*下2*/ {0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10}, /*下3*/ {0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40}, /*下4*/ {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40}, /*下5*/ {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下6*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},{0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下7*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下8*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下9*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, /*下9*/ {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#define uint unsigned int //宏定义
#define uchar unsigned char
uchar number=0,count,qi=0; //number动力数 count层扫描用的数 qi可以在数组里面定位初始地址
uint jishi,ji; //计时 ji可是改变每步转换的时间
P0=0;
P2=0;
}
void delay1(int t)//延时函数
{
int i;
while(t--)
for(i=0;i<700;i++);
}
void fun(uchar *a,uchar jump0,uint d)//第二数组不动 主数组动1
{
unsigned char i,p;
3,3,3,3,8,8,8,8,//3
4,4,4,4,4,8,8,8,//4
5,5,5,5,5,5,8,8,//5
6,6,6,6,6,6,6,8,//6
7,7,7,7,7,7,7,7,//7
7,7,7,7,7,7,7,7,//8
6,6,6,6,6,6,6,8,//9
5,5,5,5,5,5,8,8,//10
{
for(count=0;count<8;count++)
{
P3=0;
fun(a,jump0,d);
P3=ceng[count];
delay1(2);
}
};
chushi() //初始函数
{ ห้องสมุดไป่ตู้
TMOD=0x01;
TH0=-5000>>8;
TL0=-5000;
TR0=1;
EA=1;
ET0=1;
ji=250;
j=1;
pa=digit;
}
void clc()//全局清屏
{
P3=0;
P2=0xff;
{
while(go) //数字浮出
{
0,0,0,10,10,10,10,10,//2
10,0,0,0,10,10,10,10,//3
10,10,0,0,0,10,10,10,//4
10,10,10,0,0,0,10,10,//5
10,10,10,10,0,0,0,10,//6
10,10,10,10,10,0,0,0,//7
{
unsigned char i,p;
p=1;
for(i=0;i<8;i++)
{
P2=p;
P0=a[table[i+d+number*8]*jump0+count+qi*8];
P2=0;
p<<=1;
}
}
zhen(uchar *a,uchar jump0,uint d)//第二数组不动 主数组动1
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//9
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//5
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//6
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//7
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//8
bit j; //控制动画往前还是往后
uchar *pa;//主数组指针可以在不同的数组之间取数
uchar code ceng[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//层扫描的数组
uchar code digit[]=
{
0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,//数字浮出
4,4,4,4,4,8,8,8,//11
3,3,3,3,8,8,8,8,//12
2,2,2,8,8,8,8,8,//13
1,1,8,8,8,8,8,8,//14
0,8,8,8,8,8,8,8,//15
0,10,10,10,10,10,10,10,//0
0,0,10,10,10,10,10,10,//1
}
zhen1(uchar *a,uchar jump0,uint d)//第二数组动 主数组不动 jump0主数组跳的距离 d第二数组的初始地址
{
for(count=0;count<8;count++)
{
P3=0;
0x00,0x00,0x00,
0x08,0x0C,0x08,0x08,0x08,0x08,0x08,0x3E,//1
0x00,0x00,0x00,
0x3C,0x20,0x20,0x3C,0x04,0x04,0x3C,0x00,//2
0x00,0x00,0x00,
0x3C,0x20,0x20,0x3C,0x20,0x20,0x3C,0x00,//3
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
uchar code zheng[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,//0 正方形用的数组
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,//1
0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,//2
0x00,0x00,0x00,0x00,0x0f,0x0f,0x0f,0x0f,//3
0x00,0x00,0x00,0x1f,0x1f,0x1f,0x1f,0x1f,//4
0x00,0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,//5
0x7C,0x44,0x44,0x7C,0x44,0x44,0x7C,0x00,//8
0x7C,0x44,0x44,0x7C,0x40,0x40,0x7C,0x00,//9
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
fun1(a,jump0,d);
P3=ceng[count];
delay1(2);
}
}
main()
{
uchar xun;//控制每步动画的循环
bit go; //每步动画之间的联系
go=1;
chushi();
while(1)
0x00,0x00,0x00,
0x10,0x18,0x14,0x3E,0x10,0x10,0x00,0x00,//4
0x00,0x00,0x00,
0x78,0x08,0x08,0x78,0x40,0x40,0x78,0x00,//5
0x00,0x00,0x00,
0x78,0x08,0x08,0x78,0x48,0x48,0x78,0x00,//6
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//10
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
{
0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,//0
0x08,0x0C,0x08,0x08,0x08,0x08,0x08,0x3E,//1
0x3C,0x20,0x20,0x3C,0x04,0x04,0x3C,0x00,//2
0x3C,0x20,0x20,0x3C,0x20,0x20,0x3C,0x00,//3
0x00,0x00,0x00,
0x78,0x40,0x40,0x40,0x40,0x40,0x00,0x00,//7
0x00,0x00,0x00,
0x7C,0x44,0x44,0x7C,0x44,0x44,0x7C,0x00,//8
0x00,0x00,0x00,
0x7C,0x44,0x44,0x7C,0x40,0x40,0x7C,0x00,//9
};
uchar code table[]= //第二数组 选择不同的方式给每个面送数
{
1,1,0,0,0,1,1,1,//d=0
0,8,8,8,8,8,8,8,//0 d=8