微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 单片机驱动点阵16*16综合C程序-包含各种效果

单片机驱动点阵16*16综合C程序-包含各种效果

时间:11-29 来源:互联网 点击:
一、硬件简介: 经过努力,终于完成了我以前一直的梦想,点阵各种模式能独立原创出点阵屏各种模式:间断、上移、下移、左移、右移、上拉幕、下拉幕、左拉幕、右拉幕、左覆盖、右覆盖等等模式,我认为点阵只要是上移、左移会了,基本其它的都会了!一定要理解了,才算哟,太高兴了,现在和大家分享下了,我的硬件是:行是译码器74HC154+S8550,列是74HC595移位寄存器.

祥细视频如下http://www.tudou.com/programs/view/D0SCJyO4RBQ/ 
完整的程序源代码下载:http://www.51hei.com/f/dz854.rar

二、具体原理图见

电路介绍:http://www.51hei.com/mcu/1523.html

三、具体程序代码如下:

#include

#define uchar unsigned char

#define uint unsigned int

#define LINE P0//定义行线IO口,即74HC154控制端

#define shudu 12//字移动的速度

sbit DATA=P1^4;//74HC595数据端

sbit CLK=P1^5;//74HC595移位脉冲端

sbit CLKR=P1^6;//74HC595数据锁存端

uchar move;//移动几位变量

uchar line;//行变量

uint word;//字节变量

uchar ji,gai;//字节变量

uchar BUF[4];//4组缓存数组以便左移右移等功能动态更改数据

/************************************************************/

/**********上移上拉左移左拉左覆盖数组************************/

/************************************************************/

uchar code table[]={

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,0x10,0x3F,0xF8,0x04,0x10,0x04,0x14,0xFF,0xFE,0x04,0x10,0x04,0x10,

0x3F,0xF0,0x04,0x10,0x04,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,

0x01,0x00,0x01,0x08,0x7F,0xFC,0x01,0x00,0x3F,0xF8,0x01,0x00,0xFF,0xFE,0x00,0x10,

0x1F,0xF8,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x10,0x50,0x10,0x20,

0x01,0x10,0xFF,0x90,0x14,0x50,0x14,0x7C,0x7F,0x50,0x55,0x90,0x55,0x10,0x57,0xFE,

0x61,0x04,0x41,0x7E,0x41,0x44,0x7F,0x44,0x41,0x44,0x41,0x44,0x7F,0x7C,0x41,0x44,

0x00,0x78,0x3F,0x80,0x11,0x10,0x09,0x20,0x7F,0xFE,0x42,0x02,0x82,0x04,0x7F,0xF8,

0x04,0x00,0x07,0xF0,0x0A,0x20,0x09,0x40,0x10,0x80,0x11,0x60,0x22,0x1C,0x0C,0x08,

0x04,0x40,0x04,0x44,0xFF,0xFE,0x04,0x40,0x08,0x7C,0x09,0x44,0x7F,0xC4,0x08,0x7C,

0x0A,0x44,0x3F,0x44,0x22,0x7C,0x22,0x44,0x22,0x44,0x3E,0x44,0x22,0x94,0x01,0x08,

0x08,0x20,0x08,0x24,0xFF,0xFE,0x08,0x20,0x01,0x08,0x3F,0xFC,0x20,0x08,0x20,0x08,

0x3F,0xF8,0x20,0x08,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,

0x08,0x10,0x08,0x10,0x08,0x10,0x10,0x20,0x10,0x20,0x22,0x44,0x7E,0xFC,0x04,0x08,

0x08,0x10,0x10,0x20,0x20,0x40,0x7E,0xFC,0x00,0x00,0x00,0x04,0xFF,0xFE,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

};

/************************************************************/

/**********************下拉、下移数组************************/

/************************************************************/

uchar code table1[]={

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,

0x08,0x10,0x08,0x10,0x08,0x10,0x10,0x20,0x10,0x20,0x22,0x44,0x7E,0xFC,0x04,0x08,

0x08,0x10,0x10,0x20,0x20,0x40,0x7E,0xFC,0x00,0x00,0x00,0x04,0xFF,0xFE,0x00,0x00,

0x08,0x20,0x08,0x24,0xFF,0xFE,0x08,0x20,0x01,0x08,0x3F,0xFC,0x20,0x08,0x20,0x08,

0x3F,0xF8,0x20,0x08,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,

0x04,0x40,0x04,0x44,0xFF,0xFE,0x04,0x40,0x08,0x7C,0x09,0x44,0x7F,0xC4,0x08,0x7C,

0x0A,0x44,0x3F,0x44,0x22,0x7C,0x22,0x44,0x22,0x44,0x3E,0x44,0x22,0x94,0x01,0x08,

0x00,0x78,0x3F,0x80,0x11,0x10,0x09,0x20,0x7F,0xFE,0x42,0x02,0x82,0x04,0x7F,0xF8,

0x04,0x00,0x07,0xF0,0x0A,0x20,0x09,0x40,0x10,0x80,0x11,0x60,0x22,0x1C,0x0C,0x08,

0x01,0x10,0xFF,0x90,0x14

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top