光立方8x8x8 -595-参考国外函数-动画

上传人:子 文档编号:43335838 上传时间:2018-06-05 格式:DOC 页数:43 大小:28.24KB
返回 下载 相关 举报
光立方8x8x8 -595-参考国外函数-动画_第1页
第1页 / 共43页
光立方8x8x8 -595-参考国外函数-动画_第2页
第2页 / 共43页
光立方8x8x8 -595-参考国外函数-动画_第3页
第3页 / 共43页
光立方8x8x8 -595-参考国外函数-动画_第4页
第4页 / 共43页
光立方8x8x8 -595-参考国外函数-动画_第5页
第5页 / 共43页
点击查看更多>>
资源描述

《光立方8x8x8 -595-参考国外函数-动画》由会员分享,可在线阅读,更多相关《光立方8x8x8 -595-参考国外函数-动画(43页珍藏版)》请在金锄头文库上搜索。

1、光立方光立方 8X8X88X8X8 -595-595-参考国外函数参考国外函数- -动画动画#include “STC12C5A.H“#include #define uint unsigned int#define uchar unsigned char/*/sbit AD=P10; /定义音频输入接口 sbit gm=P11; /定义光敏输入接口sbit K1=P00; /定义功能按键接口sbit K2=P01; /定义功能按键接口sbit K3=P02; /定义功能按键接口sbit K4=P03; /定义功能按键接口sbit L1602_RS_POW=P44; /定义电源功能接口 低电平

2、sbit IR_IN=P32; /红外线信号/http:/ M_HR_DS0=P14; /模拟数据发送端口sbit M_LR_DS0=P15; /模拟数据发送端口sbit M_HG_DS0=P16; /模拟数据发送端口sbit M_LG_DS0=P07; /模拟数据发送端口sbit CLK=P13; /模拟时钟控制端口/sbit SUO=P12; /模拟锁存信号端口sbit STCP = P12;/*$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$*/sbit a=P34; /行

3、数据扫描信号sbit b=P35; /行数据扫描信号sbit c=P36; /行数据扫描信号sbit d=P37; /行数据扫描信号sbit en=P17; /行数据扫描信号/*/*Ideasofthttp:/Display memery:display88;*/#include “reg52.h“/#include/#define uchar unsigned char/#define uint unsigned int/sbit STCP = P32;/uchar display88;/*rank:A,1,2,3,4,I,心,U*/uchar code table_cha88=0x51,0

4、x51,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,0x3c,0x3c,0x66,0xff,0xff,0xff,0x7e,0x3c,0x18,0x18,0x66,0x66,0x66,0x66,0x66,0x6

5、6,0x7e,0x3c;/*the “ideasoft“*/uchar code table_id40=0x81,0xff,0x81,0x00,0xff,0x81,0x81,0x7e,0x00,0xff,0x89,0x89,0x00,0xf8,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;/*railway*/uchar code dat128=0x0,0x20,0x40,0x60,0

6、x80,0xa0,0xc0,0xe0,0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xfc,0xdc,0xbc,0x9c,0x7c,0x5c,0x3c,0x1c,0x18,0x14,0x10,0xc,0x8,0x4,0x25,0x45,0x65,0x85,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,0x6f

7、,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,0x31,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,

8、0xc,0x8,0x4;/*railway 2*/uchar code dat228=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;/*railway 3*/uchar code dat324=0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x16,0x26,0x36,0x46,0x56,0x66,0x65,0x64,0x63,0x62,0x61,

9、0x60,0x50,0x40,0x30,0x20,0x10;/*3p char*/uchar code table_3p38=0xff,0x89,0xf5,0x93,0x93,0xf5,0x89,0xff,0x0e,0x1f,0x3f,0x7e,0x7e,0x3f,0x1f,0x0e,0x18,0x3c,0x7e,0xff,0x18,0x18,0x18,0x18;/*initializtionThat is to initialize the program .It is write to set the timer in c52 mcu.So the program can renovate

10、 the led_3d_cube in fixed time use the interrupt function.*/void sinter(void)IE=0x82;TCON=0x01;TH0=0xc0;TL0=0;TR0=1;TMOD = 0x20;PCON = 0x00;SCON = 0x00;void delay(uint i)uchar b;while (i-)b=3; /改速度用 值越小速度越快while(b-);/*判断一个数值的第 n 位,是 1 还是 0,并返回相应数值*/uchar judgebit(uchar num,uchar b)char n;num=numretu

11、rn b;/*To figure out the absolute value*/uchar abss(char a)if (a(*b)t=(*a);(*a)=(*b);(*b)=t; /*The function is to figure out the max number and return it.*/uchar maxt(uchar a,uchar b,uchar c)if (a=-3;i-)if (i=0)for (j=0;j=0)if (dir)cp=127-cpp;else cp=cpp; a=(datcp5)b=(datcp2)c=datcpif (cpp63)c=7-c;p

12、oint (a,b,c,le);void line(uchar x1,uchar y1,uchar z1,uchar x2,uchar y2,uchar z2,uchar le)char t,a,b,c,a1,b1,c1,i;a1=x2-x1;b1=y2-y1;c1=z2-z1;t=maxt(abss(a1),abss(b1),abss(c1);a=x1*10;b=y1*10;c=z1*10;a1=a1*10/t;b1=b1*10/t;c1=c1*10/t;for (i=0;i=0)i-)for (j=0;j=0)delay(speed);void tranoutchar(uchar c,ui

13、nt speed)uchar i,j,k,a,i2=0;for (i=0;i0;i-)cirp(i-2,0,1);delay(8000);cirp(i-1,0,0);delay(8000);for (i=0;i0;i-)cirp(i-2,0,1);delay(8000);delay(8000);for (i=0;i=0;i-)box_apeak_xy(0,i,0,7,i,7,1,1);delay(20000);if (i0)box_apeak_xy(0,i,0,7,i,7,1,0);for (i=0;i=0)line(0,anj,j,7,anj,j,1);for (j=0;j=0)line(0

14、,anj+1,j,7,anj+1,j,0);for (j=0;j0)anj-;delay(15000);for (j=0;j=0)line(0,anj,j,7,anj,j,1);for (j=0;j0)line(0,anj-1,j,7,anj-1,j,0);for (j=0;j3)anj-;delay(a);/2i=3;for (j=0;j0)anj-;delay(a);/3i=3;for (j=1;j=0)box_apeak_xy(j,anj,j,7-j,anj,7-j,0,1);if (anj0)box_apeak_xy(j,anj-1,j,7-j,anj-1,7-j,0,0);for (j=1;j3)box_apeak_xy(j,anj,j,7-j,anj,7-j,0,1);if (anj3)box_apeak_xy(j,anj-1,j,7-j,anj-1,7-j,0,0);for (j=0;j3)anj-;delay(a);/6i=3;for (j=0;j0)anj-;delay(a);/7i=3;for (j=0;j=0)box_apeak_xy(j,anj,j,7-j

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号