现在搞LED灯箱广告牌,价格低寿命长等特点,大家可以通过以下链接地址去看以下不同LED灯箱广告牌显示效果,不过也可以根据客户要求进行设计,如果有坛友需要可以 联系赣赣镇大伞庄赵先生:电话:18300398990 价格实惠,平方个数字个数 200 - 500元以内设计 如果定做LED灯箱尺寸比较多可以联系赵先生进行具体价格设计。
LED灯箱效果图链接地址:http://xiangce.baidu.com/picture ... 6?isscore=1#isScore
以下我是的LED显示屏程序代码。
/***********************************************************
*
*
* 16x32点阵双色LED显示屏左移显示
*
*
*
*
*
*
*
*
************************************************************/
#include "STC89C5X.H"
#include "Ziku.H"
/*
* 定义数据类型
*/
typedef unsigned char UINT_8U;
typedef unsigned int UINT_16U;
/*
* 定义端口
*/
//#define SRE_595 P3_6 //红色输入
#define SGE_595 P1_6 //绿色输入
#define SCK_595 P1_5 //595时钟信号
#define RCK_595 P1_4 //595移位时钟
#define A_138 P1_0 //138输入A
#define B_138 P1_1 //138输入B
#define C_138 P1_2 //138输入C
#define D_138 P1_3 //138输入D
#define OE_GT P1_7 //595使能,低电平输入有效
/*
* 屏刷新亮度
*/
#define SPEE1 500 //高亮
#define SPEE2 120 //正常亮度
#define SPEE3 50 //亮度暗
/*
* 字数和扫描方式
*/
#define MAIN_DATA 8 //595移动8位数据
#define SCREEN_SIZE 4 //16x32屏2个字 4个595
#define SIAOMIAO 16 //扫描方式16分之一 两个138刚好输出16位
/*
* 显示开关
*/
#define ON_DISPLAY OE_GT = 0 //开启显示 595 OE使能拉低输出有效数据
#define OFF_DISPLAY OE_GT = 1 //关闭显示 595 OE使能拉高输出无效
/*
* 定义变量
*/
UINT_8U data MAIN_ZiBuF[10]; //把一屏显示2个字的字库放入数组
UINT_8U MAIN_Logo; //变量判断16x16点阵字体高八位 = 1,低八位 = 0
UINT_16U MAIN_Zimuo; //计算当前显示到那个字变量
UINT_8U MAIN_Seep; //移动速度变量
UINT_8U MAIN_Move; //移动数据16位变量
UINT_8U MAIN_Rowd; //行扫描变量
UINT_8U CountRevk;
/*
* 带形参延时子函数用来调节显示亮度
*/
void Delay_1ms(unsigned char Clva)
{
unsigned char Time;
for(Time = 0; Time < Clva; Time++)
{;}
}
/*
* 取4个字的字模写入数组内部子函数
*/
void Write_DisplayArray(UINT_16U MAIN_Zisu, UINT_8U MAIN_Line)
{
unsigned char i;
for(i = 0; i < SCREEN_SIZE; i++)
{
MAIN_ZiBuF[i * 2 + 0] = MAIN_Ziku[MAIN_Zisu + 0 + 32 * i + 2 * MAIN_Line];
MAIN_ZiBuF[i * 2 + 1] = MAIN_Ziku[MAIN_Zisu + 1 + 32 * i + 2 * MAIN_Line];
}
}
/*
* 把显示数组写595移位寄存器子函数
*/
void Corrent_DisplayData(unsigned char MAIN_Soue)
{
unsigned char i;
unsigned char MAIN_Logo;
unsigned char MAIN_Value;
if(MAIN_Soue < MAIN_DATA)
{
MAIN_Logo = 0;
}
else
{
MAIN_Logo = 1;
}
for(i = 0 + MAIN_Logo; i < SCREEN_SIZE + MAIN_Logo; i++)
{
if(MAIN_Soue < MAIN_DATA)
{
MAIN_Value = MAIN_Soue;
}
else
{
MAIN_Value = MAIN_Soue - 8;
}
ACC = (MAIN_ZiBuF << MAIN_Value) | (MAIN_ZiBuF[i + 1] >> (8 - MAIN_Value));
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
SCK_595 = 0; ACC <<= 1; SGE_595 = CY; SCK_595 = 1;
}
}
void SystemInit(void)
{
TMOD = 0x01;
TH0 = (65536 - 100) / 256;
TL0 = (65536 - 100) % 256;
EA = 1;
ET0 = 1;
TR0 = 0;
}
/*
* 程序函数主体
*/
int main(void)
{
SystemInit();
P0 = 0xFF; //初始化
P1 = 0xFF;
P2 = 0xFF;
P3 = 0xFF;
P4 = 0xFF;
MAIN_Zimuo = 0;
while(1)
{
while(MAIN_Zimuo < MAIN_CAlate) //判断显示数字
{
for(MAIN_Move = 0; MAIN_Move < 16; MAIN_Move++) //移动1一个字16位数据
{
for(MAIN_Seep = 0; MAIN_Seep < 8; MAIN_Seep++) //移动速度
{
for(MAIN_Rowd = 0; MAIN_Rowd < SIAOMIAO; MAIN_Rowd++) //行扫描
{
Write_DisplayArray(MAIN_Zimuo, MAIN_Rowd);
Corrent_DisplayData(MAIN_Move);
P1 &= 0xF0;
P1 |= MAIN_Rowd;
RCK_595 = 1;
RCK_595 = 0;
ON_DISPLAY;
// Delay_1ms(SPEE3);
TR0 = 1;
while(TR0);
OFF_DISPLAY;
}
}
}
MAIN_Zimuo += 32;
}
MAIN_Zimuo = 0;
}
}
/*
* 定时器刷新显示
*/
void Timer0(void)interrupt 1
{
TH0 = (65536 - 100) / 256;
TL0 = (65536 - 100) % 256;
CountRevk++;
if(CountRevk == 4)
{
CountRevk = 0;
TR0 = 0;
}
}
/***********************************************************
*
*
*
*
*
*
*
*
*
*
*
************************************************************/
#include "Ziku.H"
unsigned int MAIN_CAlate;
const unsigned char code MAIN_Ziku[] =
{
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF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