https://static.assets-stash.eet-china.com/album/old-resources/2009/2/1/ff1021b8-4921-4013-88d8-cc924e11199e.rar" target=_blank>
两种方法,一种直接用单片机I/O驱动,
另一种用74HC595驱动,只需三个I/O口
keil C 文件和Proteus文件打包下载
包含以下内容:
├─16X16汉字点阵
├─32.16点阵
├─64X32LED點陣屏
├─点阵8X8
├─基于单片机的俄罗斯方块游戏的实现
├─点阵16X16
├─8.8LED点阵字库软件
├─16X16点阵飞机射击游戏
├─点阵控制(16 64)
├─8字文字流动显示
└─16X16_Dot
一种直接用单片机I/O驱动(当然这是仿真,实际上并不可靠,很暗的)
/*--------------------------------------------------------------*/
//LED8*8滚动显示
//列扫描,低电平有效
#include <reg52.h>
/*--------------------------------------------------------------*/
//接口定义
#define L P0 //列
#define R P2 //行
/*--------------------------------------------------------------*/
//代码库
#define num sizeof(table) //代码长度
unsigned char code table[]= {
/*-- 宽度x高度=200x8 --*/
0x00,0x00,0x00,0x00,0x00,
0x00,0x42,0x7E,0x42,0x00,0x00,0x00,0x7E,0x40,0x40,0x00,0x7E,0x42,0x7E,0x00,0x3E,
0x40,0x3E,0x00,0x7E,0x52,0x52,0x00,0x00,0x00,0x0E,0x70,0x0E,0x00,0x7E,0x42,0x7E,
0x00,0x7E,0x40,0x7E,0x00,0x00,0x00,0x42,0x7E,0x40,0x00,0x52,0x52,0x7E,0x00,0x42,
0x7E,0x40,0x18,0x14,0x7E,0x10,0x00,0x1C,0x22,0x44,0x22,0x1C,0x00,0x00,0x3C,0x42,
0x4A,0x62,0x4A,0x42,0x3C,0x00,0x00,0x7E,0x10,0x7E,0x00,0x7C,0x12,0x7C,0x00,0x7E,
0x0A,0x0E,0x00,0x7E,0x0A,0x0E,0x00,0x0E,0x70,0x0E,0x00,0x00,0x00,0x7E,0x04,0x18,
0x20,0x7E,0x00,0x7E,0x52,0x52,0x00,0x3E,0x40,0x7E,0x40,0x3E,0x00,0x00,0x00,0x0E,
0x70,0x0E,0x00,0x7E,0x52,0x52,0x00,0x7C,0x12,0x7C,0x00,0x7E,0x1A,0x6E,0x00,0x00,
0x72,0x52,0x5E,0x00,0x7E,0x42,0x7E,0x00,0x7E,0x42,0x7E,0x00,0x5E,0x52,0x7E,0x00,
0x08,0x08,0x08,0x00,0x7E,0x42,0x7E,0x00,0x72,0x52,0x5E,0x00,0x08,0x08,0x08,0x00,
0x7E,0x42,0x7E,0x00,0x42,0x7E,0x40,0x00,0x00,0x00,0x42,0x7E,0x40,0x00,0x52,0x52,
0x7E,0x00,0x24,0x00,0x18,0x14,0x7E,0x10,0x00,0x5E,0x52,0x7E,0x00,0x00,0x00,0x0C,
0x02,0x4C,0x40,0x4C,0x02,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
/*--------------------------------------------------------------*/
//延时5000+0us 函数定义
void delay1(void)
{
unsigned char i, j;
for(i = 185; i > 0; i--)
for(j = 12; j > 0; j--);
}
/*--------------------------------------------------------------*/
//主函数
void main (void)
{
unsigned char m, i;
unsigned int n;
while(1)
{
L = ~(0x01 << i); //开始列扫描
R = table[i + n]; //查表取出数据
delay1(); //延迟时间
i++; if(i == 8) i = 0; //循环扫描
m++; if(m == 50) {m = 0; n++;} //滚动速度控制
if(n == num-7) n = 0; //循环显示
}
}
用户149863 2009-4-25 08:41
用户78220 2009-4-21 11:31