全在附件里面,包括光立方原理图,源程序,取模软件,上位机软件,相关文档==,想要的东西基本在里面了,已经测试过没有问题。
电路原理图如下:
单片机源程序如下:- /*---------------------------------------------------------------------------------------------------
- * 上升沿电子
- -----------------------------------------------------------------------------------------------------*/
- //Build target 'Target 1'
- //compiling stc8x8x8.c...
- //linking...
- //Program Size: data=17.1 xdata=355 code=53475
- //creating hex file from "stc8x8x8"...
- //"stc8x8x8" - 0 Error(s), 0 Warning(s).
- //没有关闭店字样的显示函数 FLASH_12 FLASH_14 FLASH_18 如果需要自己关闭函数即可
- #include "STC12C5A.H" //包含单片机的头文件使用KEIL必须添加进来否则编译不了
- #include "intrins.h" //包含NOP延时头文件
- #define uchar unsigned char
- #define uint unsigned int
- #define nop() _nop_();_nop_();
- void key_baihei_scan();
- void key_shangwiej_scan();
- void key_donghua_scan();
- void key_yinyue_scan();
- void box(unsigned char x1,unsigned char z1,unsigned char y1,unsigned char x2,unsigned char z2,unsigned char y2,unsigned char fill,unsigned char le);
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- sbit AD=P1^0; //定义音频输入接口
- sbit GM=P1^1; //定义光敏输入接口
- sbit K1=P0^0; //定义功能按键接口
- sbit K2=P0^1; //定义功能按键接口
- sbit K3=P0^2; //定义功能按键接口
- sbit K4=P0^3; //定义功能按键接口
- sbit PWM_POW=P4^4; //定义PWM呼吸小夜灯和主板电源指示灯功能接口 低电平
- sbit IRIN=P3^2; //红外线信号接口
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- sbit M_HR_DS0=P1^4; //模拟数据发送端口
- sbit M_LR_DS0=P1^5; //模拟数据发送端口
- sbit M_HG_DS0=P1^6; //模拟数据发送端口
- sbit M_LG_DS0=P0^7; //模拟数据发送端口
- sbit CLK=P1^3; //模拟时钟控制端口
- sbit SUO=P1^2; //模拟锁存信号端口
- /*$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$-_-$_-_$*/
- sbit M_A=P3^4; //行数据扫描信号
- sbit M_B=P3^5; //行数据扫描信号
- sbit M_C=P3^6; //行数据扫描信号
- sbit M_D=P3^7; //行数据扫描信号
- sbit M_EN=P1^7; //行数据扫描信号
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- unsigned char displayck[]=
- {
- 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,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- };
- unsigned char shuzu8X8[]=
- {
- 0XBD,0X85,0X85,0XBD,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,
- 0XA1,0XA1,0XA1,0XBD,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,
- };
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- uchar xdata display[8][8];
- uchar xdata msd=4;
- uint ld=500;
- uchar test=0,key1=0,key2=0,key3=0,key4=0;
- bit pu;
- uchar xsdsq=0;
- uchar cd=0,cnt=0,errd_flag=0,read_flag=0,layerr=0,saom=0;
- unsigned char IRCOM[7];
- /*rank:A,1,2,3,4,I,心,U*/
- 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,0x0c,0x06,0x7e,
- 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,0x66,0x7e,0x3c,
- };
- /*the "ideasoft"*/
- /*rank:A,1,2,3,4,I,心,U*////开机的LOGO显示字符字模提取PLC2002
- uchar code table_cha_sj[8][8]=
- {
- 0x08,0x08,0x78,0x08,0x08,0x08,0x08,0xFF,/*"上",0*/
- 0x18,0x04,0x22,0x24,0xFF,0x24,0x24,0x24,/*"升",0*/
- 0x78,0x49,0xCE,0x00,0xFF,0x84,0x86,0xFD,/*"沿",0*/
- 0x3C,0x42,0xA5,0xDB,0x81,0x99,0x42,0x3C,/*"笑脸",0*/
- 0x3C,0x42,0xA5,0xDB,0x81,0x99,0x42,0x3C,/*"笑脸",0*/
- 0x08,0x2A,0x2A,0xFF,0x14,0x14,0x96,0x71,/*"光",0*/
- 0x08,0x7F,0x22,0x22,0x24,0x14,0x14,0xFF,/*"立",0*/
- 0x08,0xFF,0x04,0x7C,0x44,0x44,0x42,0x31,/*"方",0*/
- };
- /*rank:3,D,C,L,U,E,F,F,T*///开机的LOGO显示字符字模提取PLC2002
- uchar code table_cha_cu[9][8]=
- {
- 0x7E,0x40,0x40,0x7C,0x7C,0x40,0x40,0x7E,/*"3",0*/
- 0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,/*"D",0*/
- 0x00,0x3C,0x02,0x02,0x02,0x02,0x02,0x3C,/*"C",0*/
- 0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x7C,/*"L",0*/
- 0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,/*"U",0*/
- 0x00,0x7E,0x02,0x02,0x7E,0x02,0x02,0x7E,/*"E",0*/
- 0x78,0x04,0x04,0x04,0x7C,0x04,0x04,0x04,/*"F",0*/
- 0x78,0x04,0x04,0x04,0x7C,0x04,0x04,0x04,/*"F",0*/
- 0x00,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,/*"T",0*/
- };
- uchar code table_id[40]=
- {
- 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,0x00,0x01,0x01,0xff,0x01,0x01,0x00,
- };
- /*the "ideasoft"*///侧面移动显示字符取摸plc2002
- uchar code table_yd[120]={
- 0x08,0x08,0x78,0x08,0x08,0x08,0x08,0xFF,/*"上",0*/
- 0x18,0x04,0x22,0x24,0xFF,0x24,0x24,0x24,/*"升",0*/
- 0x78,0x49,0xCE,0x00,0xFF,0x84,0x86,0xFD,/*"沿",0*/
- 0x7E,0x2A,0x2A,0xFF,0xAA,0xAA,0xBE,0x40,/*"电",0*/
- 0x09,0x49,0x89,0xFD,0x0B,0x0B,0x09,0x08,/*"子",0*/
- 0x00,0x7C,0x92,0x92,0x92,0x92,0x7C,0x00,/*"8",0*/
- 0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,/*"x",0*/
- 0x00,0x7C,0x92,0x92,0x92,0x92,0x7C,0x00,/*"8",0*/
- 0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,/*"x",0*/
- 0x00,0x7C,0x92,0x92,0x92,0x92,0x7C,0x00,/*"8",0*/
- 0x88,0x4E,0x78,0x0F,0xF8,0x8E,0x88,0x48,/*"光",0*/
- 0x82,0x8E,0xF2,0x83,0xE2,0x9E,0x82,0x80,/*"立",0*/
- 0x82,0x42,0x3E,0x0B,0x8A,0x8A,0x7A,0x02,/*"方",0*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- /*railway*/
- uchar code dat[128]=
- {
- 0x00,0x20,0x40,0x60,0x80,0xa0,0xc0,0xe0,
- 0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xfc,0xdc,
- 0xbc,0x9c,0x7c,0x5c,0x3c,0x1c,0x18,0x14,
- 0x10,0x0c,0x08,0x04,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,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,0x00,0x20,0x40,0x60,
- 0x80,0xa0,0xc0,0xe0,0xe4,0xe8,0xec,0xf0,
- 0xf4,0xf8,0xfc,0xdc,0xbc,0x9c,0x7c,0x5c,
- 0x3c,0x1c,0x18,0x14,0x10,0x0c,0x08,0x04,
- };
- /*railway 2*/
- uchar code dat2[28]=
- {
- 0x00,0x20,0x40,0x60,0x80,0xa0,0xc0,0xe0,
- 0xe4,0xe8,0xec,0xf0,0xf4,0xf8,0xfc,0xdc,
- 0xbc,0x9c,0x7c,0x5c,0x3c,0x1c,0x18,0x14,
- 0x10,0x0c,0x08,0x04,
- };
- /*railway 3*/
- uchar code dat3[24]=
- {
- 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x16,
- 0x26,0x36,0x46,0x56,0x66,0x65,0x64,0x63,
- 0x62,0x61,0x60,0x50,0x40,0x30,0x20,0x10,
- };
- /*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,
- };
- /*3p char*///飘雪打字显示字符取摸plc2002
- uchar code table_3p_zf[11][8]={
- 0x88,0x4E,0x78,0x0F,0xF8,0x8E,0x88,0x48,/*"光",0*/
- 0x82,0x8E,0xF2,0x83,0xE2,0x9E,0x82,0x80,/*"立",0*/
- 0x82,0x42,0x3E,0x0B,0x8A,0x8A,0x7A,0x02,/*"方",0*/
- 0x00,0x7C,0x92,0x92,0x92,0x92,0x7C,0x00,/*"8",0*/
- 0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,/*"x",0*/
- 0x00,0x7C,0x92,0x92,0x92,0x92,0x7C,0x00,/*"8",0*/
- 0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,/*"x",0*/
- 0x00,0x7C,0x92,0x92,0x92,0x92,0x7C,0x00,/*"8",0*/
- 0x00,0x00,0xC3,0xFF,0xFF,0xC3,0x00,0x00,//i
- 0x0e,0x1f,0x3f,0x7e,0x7e,0x3f,0x1f,0x0e,
- 0x00,0x7F,0xFF,0x80,0x80,0xFF,0x7F,0x00,//u
- };
- unsigned int voivol(unsigned int n);
- void sendbyte(unsigned int num1,unsigned int num2,unsigned int num3,unsigned int num4);
- void fvb();
- void sendbyteck(unsigned int num1,unsigned int num2,unsigned int num3,unsigned int num4);
- /*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.*/
- /*##########################################################################################*/
- uchar code number[]={//数字,滚动字幕使用,从上至下
- 0x00,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,/*"L",0*/
- 0x00,0x7E,0x40,0x7E,0x40,0x40,0x7E,0x00,/*"E",1*/
- 0x00,0x7C,0x46,0x42,0x42,0x46,0x7C,0x00,/*"D",2*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",3*/
- 0x00,0x3C,0x62,0x40,0x40,0x61,0x3E,0x00,/*"C",4*/
- 0x00,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,/*"U",5*/
- 0x00,0x7C,0x42,0x7C,0x42,0x41,0x7E,0x00,/*"B",6*/
- 0x00,0x7E,0x40,0x7E,0x40,0x40,0x7E,0x00,/*"E",7*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",8*/
- 0x00,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,/*"H",9*/
- 0x00,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,/*"U",10*/
- 0x00,0xC2,0x64,0x38,0x10,0x10,0x10,0x00,/*"Y",11*/
- 0x00,0x18,0x18,0x24,0x7E,0x42,0x81,0x00,/*"A",12*/
- 0x00,0x62,0x62,0x52,0x4A,0x46,0x46,0x00,/*"N",13*/
- 0x00,0x3C,0x62,0x40,0x4E,0x62,0x3E,0x00,/*"G",14*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",15*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",16*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",17*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"Y",18*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",19*/
- 0x00,0x44,0x44,0x7C,0x44,0x44,0x44,0x00,/*"H",20*/
- 0x00,0x44,0x44,0x44,0x44,0x44,0x38,0x00,/*"U",21*/
- 0x00,0x82,0x44,0x28,0x10,0x10,0x10,0x00,/*"Y",22*/
复制代码
上图资料下载:
888光立方资料.7z
(8.05 MB, 下载次数: 24)
|