资源简介
KEIL MDK工程代码,用C语言编写51单片机控制4*4*4阶光立方,能够在光立方上显示任意的立体形状,很炫酷,博主课程设计项目,实测可用!!
代码片段和文件信息
//公 司:Alpha
//作 者:张虎
//工程名称:4阶光立方驱动程序
//MCU:stc12c5a60s2
//时间:2015/4/18
//版本:v1.0
//硬件连接关系
// P2.0--->X1 P1.0--->Y1 P0.0--->Z1
// P2.1--->X2 P1.1--->Y2 P0.1--->Z2
// P2.2--->X3 P1.2--->Y3 P0.2--->Z3
// P2.3--->X4 P1.3--->Y4 P0.3--->Z4
//说明:X、Y、Z表示led灯的三维坐标,且都是输出高电平有效
#include
#include
#define uint unsigned int
#define uchar unsigned char
#define frame 147 //设置动画的默认帧数为32帧
#define coordinate 8 //设置一帧图像包含的坐标点用8字节表示
//硬件端口定义
#define X_axle P2
#define Y_axle P1
#define Z_axle P0
//图像数据
uchar code image_source[frame][coordinate]=
{
0x100x000x310x000x730x100xF70x31 //填满动画
0x100x000x310x000x730x100xFF0x31
0x100x000x310x000x730x100xFF0x71
0x100x000x310x000x730x100xFF0x73
0x100x000x310x000x730x100xFF0xF3
0x100x000x310x000x730x100xFF0xF7
0x100x000x310x000x730x100xFF0xFF
0x100x000x310x000xF30x100xFF0xFF
0x100x000x310x000xF70x100xFF0xFF
0x100x000x310x000xF70x300xFF0xFF
0x100x000x310x000xF70x310xFF0xFF
0x100x000x310x000xFF0x310xFF0xFF
0x100x000x310x000xFF0x710xFF0xFF
0x100x000x310x000xFF0x730xFF0xFF
0x100x000x310x000xFF0xF30xFF0xFF
0x100x000x310x000xFF0xF70xFF0xFF
0x100x000x310x000xFF0xFF0xFF0xFF
0x100x000x710x000xFF0xFF0xFF0xFF
0x100x000x730x000xFF0xFF0xFF0xFF
0x100x000x730x100xFF0xFF0xFF0xFF
0x100x000xF30x100xFF0xFF0xFF0xFF
0x100x000xF70x100xFF0xFF0xFF0xFF
0x100x000xF70x300xFF0xFF0xFF0xFF
0x100x000xF70x310xFF0xFF0xFF0xFF
0x100x000xFF0x310xFF0xFF0xFF0xFF
0x100x000xFF0x710xFF0xFF0xFF0xFF
0x100x000xFF0x730xFF0xFF0xFF0xFF
0x100x000xFF0xF30xFF0xFF0xFF0xFF
0x100x000xFF0xF70xFF0xFF0xFF0xFF
0x100x000xFF0xFF0xFF0xFF0xFF0xFF
0x300x000xFF0xFF0xFF0xFF0xFF0xFF
0x310x000xFF0xFF0xFF0xFF0xFF0xFF
0x310x000xFF0xFF0xFF0xFF0xFF0xFF
0x710x000xFF0xFF0xFF0xFF0xFF0xFF
0x710x000xFF0xFF0xFF0xFF0xFF0xFF
0x730x000xFF0xFF0xFF0xFF0xFF0xFF
0x730x100xFF0xFF0xFF0xFF0xFF0xFF
0xF30x100xFF0xFF0xFF0xFF0xFF0xFF
0xF70x100xFF0xFF0xFF0xFF0xFF0xFF
0xF70x300xFF0xFF0xFF0xFF0xFF0xFF
0xF70x310xFF0xFF0xFF0xFF0xFF0xFF
0xF70x310xFF0xFF0xFF0xFF0xFF0xFF
0xFF0x310xFF0xFF0xFF0xFF0xFF0xFF
0xFF0x710xFF0xFF0xFF0xFF0xFF0xFF
0xFF0x730xFF0xFF0xFF0xFF0xFF0xFF
0xFF0xF30xFF0xFF0xFF0xFF0xFF0xFF
0xFF0xF70xFF0xFF0xFF0xFF0xFF0xFF
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF
0x080x880x000x000x000x000x000x00 //S流水动画
0x880x800x000x000x000x000x000x00
0xC80x000x000x000x000x000x000x00
0xE00x000x000x000x000x000x000x00
0x700x000x000x000x000x000x000x00
0x310x000x000x000x000x000x000x00
0x110x100x000x000x000x000x000x00
0x010x110x000x000x000x000
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7235 2015-04-18 15:19 cube4\cube4
文件 5295 2015-04-18 15:19 cube4\cube4.hex
文件 57 2015-04-18 15:19 cube4\cube4.lnp
文件 7901 2015-04-18 15:19 cube4\cube4.M51
文件 6195 2015-04-18 15:19 cube4\cube4.plg
....... 55657 2015-04-18 15:25 cube4\cube4.uvopt
....... 13399 2015-04-18 15:20 cube4\cube4.uvproj
....... 55645 2015-04-18 15:20 cube4\cube4_uvopt.bak
....... 0 2015-04-18 09:48 cube4\cube4_uvproj.bak
文件 9216 2015-04-18 15:25 cube4\main.c
文件 15435 2015-04-18 15:19 cube4\main.LST
文件 7583 2015-04-18 15:19 cube4\main.OBJ
文件 34 2015-04-18 15:19 cube4\main.__i
文件 6376 2009-05-07 14:37 cube4\STARTUP.A51
文件 14048 2015-04-18 13:09 cube4\STARTUP.LST
文件 749 2015-04-18 13:09 cube4\STARTUP.OBJ
目录 0 2015-04-18 15:25 cube4
----------- --------- ---------- ----- ----
204825 17
相关资源
- 51单片机数码管显示万年历的程序
- 原创:51单片机操作ds18b20ds1302,lcd1
- 51单片机驱动步进电机(含电路图和
- 51单片机c语言4x4矩阵键盘实验详细操
- 51单片机-舵机控制C语言程序
- 《新概念51单片机C语言教程--入门提高
- 51单片机DIY制作:旋转LED数字显示电子
- DSM501A基于51单片机code
- 各种语言编写的pcm代码
- 51单片机-数码管时钟秒表
- 国密SM4加密解密51单片机版C源程序.
- 新概念51单片机C语言教程入门、提高
- 51单片机下oled显示ds18b20采集温度
- 电子密码锁设计
- 51单片机超声波测距小车.rar
- 基于51单片机可调电子时钟
- 51单片机测量转速
- 基于51单片机的12864液晶显示C语言源程
- 51单片机做简易计算器
- ADC0809与80C52单片机
- 基于51单片机多节点RS485通信带Protue
- at89c51单片机+矩阵键盘编写的计算器
- 云龙51单片机视频教程,目前国内公认
- 51单片机简易秒表的设计(仿真图、程
- 51单片机超声波测距KEIL+proteus.rar
- STC89C52单片机实用程序30个C语言10个汇
- 基于STC89C51单片机的DS18B20的温度报警
- 基于keil5和protues仿真的智能温度控制
- 郭天祥十天学会C51单片机视频教程地
- MCS-51单片机C语言编程100例
评论
共有 条评论