呵呵 我来发下我这一周的作品(点阵显示)
LED点阵显示,如有做点阵显示的可以拷贝一下
LED显示条屏:由32*64=2048个点构成,双色(可构成红、绿、黄三种颜色);
条屏具体面积:长30.4cm×宽15.2cm。本显示条屏可显示8个小汉字,2个大汉字。
如显示汉字不够,可级连点阵屏或进行滚动显示。
1:货物名称及数量:LED显示条屏;有少部分条屏有一个坏点
2:价格:60元一块
3:成色:二手
4:物品缺陷及改动:
5:三包或保修期:无保修,凡出售,不退货
6:卖家所在地:四川成都西华大学,
7:卖家联系方式:QQ:274835389
8:淘宝连接:http://auction1.taobao.com/auction/item_detail-0db1-0e4d81d09233333007821fc7f4a33a80.jhtml
9:运输方式及运费(圆通快递:四川省内13元一公斤,四川省外15元一公斤):
10.实物图片在百度空间较多 百度空间链接:http://hi.baidu.com/wanchun311/album/led%B5%E3%D5%F3%CF%D4%CA%BE%CC%F5%C6%C1%2832%2A64%3B%CB%AB%C9%AB%29
程序如下:
//--------------------------------
//名称:C语言实现汉字显示
//作者:wanchun311
//日期:2008年12月15日
//--------------------------------
#include "reg51.h"
#define uchar unsigned char
#define uint unsigned int
sbit CP =P1^0 ; //74HC595移时钟
sbit SCK =P1^1 ; // 74HC595锁存信号
sbit Red=P1^2 ; //红色数据输出引脚低电平有效
sbit Greed=P1^3; // 绿色数据输出引脚低电平有效
sbit Gen1=P1^4 ; //全屏控制使能1,高电平有效
sbit Gen2=P3^5 ; //全屏控制使能2,高电平有效
sbit G1 = P3^7 ; //半屏控制使能
uchar SendData;
uchar i; //换屏变量
uchar j; //换行变量
uchar m1; //每次发送数据的 起始地址
uchar code data1[]= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0C,0x00,0x00,0x01,0xFE,0x00,0x00,0x1F,0xF0,0x00,0x01,0xFC,0x80,0x00,
0x00,0x10,0xC0,0x00,0x00,0x18,0xC0,0x00,0x00,0x18,0xC0,0x00,0x00,0x18,0xC0,0x00,
0x00,0x18,0xC1,0xE0,0x00,0x19,0xFF,0xF0,0x1B,0xFF,0x80,0x78,0x0E,0x10,0x80,0x70,
0x0C,0x10,0x80,0x70,0x04,0x10,0xC0,0x70,0x04,0x30,0x7C,0x70,0x06,0x20,0x00,0x60,
0x06,0x20,0x00,0x60,0x06,0x40,0x00,0x60,0x06,0x00,0x00,0xE0,0x02,0x03,0xF8,0xC0,
0x03,0xFF,0xFC,0xC0,0x03,0x80,0x07,0xC0,0x02,0x00,0x03,0xC0,0x00,0x00,0x03,0x80,
0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};/*"西",0*/
uchar code data2[]= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x00,0x18,0xE0,0x00,
0x00,0x38,0xC2,0x00,0x00,0x30,0x43,0x00,0x00,0x60,0x47,0x00,0x00,0x60,0x4E,0x00,
0x00,0xE0,0x58,0x00,0x01,0xA0,0x70,0x00,0x03,0x20,0xC0,0x00,0x06,0x23,0x40,0x40,
0x0C,0x20,0x40,0x40,0x00,0x20,0x40,0xC0,0x00,0x20,0x7F,0xE0,0x00,0x60,0x3F,0xC0,
0x00,0x63,0x00,0x00,0x00,0x21,0x80,0x00,0x00,0x01,0x80,0xF0,0x00,0x01,0xFF,0xFC,
0x03,0xFF,0xE0,0x00,0x1F,0xC1,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,
0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,
0x00,0x01,0x80,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,
};/*"华",1*/
uchar code data3[]= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x0E,0x00,0x00,
0x00,0x07,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,
0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x1F,0x80,
0x00,0x07,0xFF,0x80,0x00,0x3F,0xC0,0x00,0x07,0xFE,0x00,0x00,0x00,0x06,0x00,0x00,
0x00,0x06,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0D,0x80,0x00,0x00,0x0C,0xC0,0x00,
0x00,0x18,0xC0,0x00,0x00,0x18,0x60,0x00,0x00,0x30,0x30,0x00,0x00,0x60,0x38,0x00,
0x00,0xC0,0x1E,0x00,0x01,0x80,0x0F,0x00,0x03,0x00,0x07,0xE0,0x0C,0x00,0x07,0xFE,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"大",2*/
};
uchar code data4[]= {
0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0x06,0x06,0x00,
0x00,0xC3,0x0E,0x00,0x00,0x63,0x8C,0x00,0x00,0x71,0x88,0x00,0x00,0x21,0x08,0x00,
0x00,0x00,0x10,0x00,0x00,0x00,0x13,0xE0,0x04,0x07,0xFC,0x78,0x07,0xFC,0x00,0x70,
0x06,0x00,0x00,0xC0,0x0E,0x00,0x60,0x80,0x1C,0x0F,0xF0,0x00,0x1C,0x3C,0x38,0x00,
0x08,0x00,0x60,0x00,0x00,0x00,0xC0,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x8F,0xE0,
0x00,0x07,0xFF,0xE0,0x03,0xFF,0xC0,0x00,0x0F,0x80,0xC0,0x00,0x00,0x00,0xC0,0x00,
0x00,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,
0x00,0x0C,0xC0,0x00,0x00,0x07,0xC0,0x00,0x00,0x03,0x80,0x00,0x00,0x01,0x00,0x00,
};/*"学",3*/
//------------------------------------
//----------字发送子程序-----------
void SendByte(void)
{
uchar m;
for(m=0;m<8;m++)
{
CP = 0;
Red = !(SendData & 0x80);
// Greed = SendData &&0x01 ;
SendData =SendData<<1;
CP = 1;
}
}
//--------------------------------------
//-----------换屏显示-------------------
void Huanping(void)
{
j++ ;
if(j==0x02)
{
Gen1 =!Gen1;
Gen2 = !Gen2;
j = 0x00;
}
}
//-----------------------------------
//----------行扫描子程序-------------
void RowsCan(void)
{ uchar scan1;
if (i==0x08)
{
G1 = ! G1;i =0x00;
Huanping();
}
scan1 =i;
scan1 =scan1<<5;
P1 = P1 & 0x1f;
P1 = P1 | scan1;
i++;
}
void SendHang(void)
{
uchar m2;
for(m2 =0;m2<4;m2++)
{
SendData = data1[m1+m2];
SendByte();
}
for(m2 =0;m2<4;m2++)
{
SendData = data2[m1+m2];
SendByte();
}
for(m2 =0;m2<4;m2++)
{
SendData = data3[m1+m2];
SendByte();
}
for(m2 =0;m2<4;m2++)
{
SendData = data4[m1+m2];
SendByte();
}
SCK = 0;
SCK = 1;
RowsCan(); //行扫描
}
//---------------------------------------
//----------发送一屏数据-----------------
void Sendping(void)
{
SendHang();
m1 = m1+ 4;
if(m1 ==128) {m1 =0;}
}
void initial(void)
{
Gen1 = 1;
Gen2 = 0;
G1 = 0;
Red = 1;
Greed =1;
SendData = 0x00;
i = 0x00;
j = 0x00;
m1 = 0x00;
}
//;---------------------------------
//;---------主程序循环--------------
void main()
{
initial();
while(1)
{
Sendping();
}
}
/*/////////////////////////////////////////////////////////////////////////////////////
///////////////汇编格式、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
//////////////////////////////////////////////////////////////////////////////////////*/
;名字:全屏显示:西华大学
;日期:2008年12月13日
;
;----------数据串输出子程序-----
;-----定义P1.0为移位时钟
;-----定义P1.1为锁存时钟
;-----定义P1.2为红色显示串行输出数据
;-----定义P1.3为绿色显示串行输出数据
;---R3 定义为字符编码相对地址
;--R2 为行 相对地址
;----R1为一字符的第几位
CP EQU P1.0
SCK EQU P1.1
Red EQU P1.2
Greed EQU P1.3
Gen1 EQU P1.4
Gen2 EQU P3.5
A1 EQU P1.5
B1 EQU P1.6
C1 EQU P1.7
G1 EQU P3.7
;--------------------------------
ORG 0000H
AJMP START
ORG 0100H
START:
MOV SP,#70H ;初始指针为70H
MOV A, #00H
SETB Gen1
CLR Gen2
CLR G1 ;G2B之高,选择上半屏
SETB Red
SETB Greed
MOV R3,#00
MOV 40H,#00H
MOV 41H,#00H
MOV 42H,#00H ;换半屏比较位
MOV 43H,#00H ;换屏比较位
MAIN:
ACALL SendData
AJMP MAIN
SendData:
ACALL Sendhang
INC 40H
INC 40H
INC 40H
INC 40H
MOV A,40H
CJNE A,#128,L2
MOV 40H,#00H
L2: RET
Sendhang:
MOV DPTR,#CHANL1
MOV A,40H
MOVC A,@A+DPTR
ACALL SendByte
MOV DPTR,#CHANL1
MOV A,40H
INC A
MOVC A,@A+DPTR
ACALL SendByte
MOV DPTR,#CHANL1
MOV A,40H
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte
MOV DPTR,#CHANL1
MOV A,40H
INC A
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte
MOV DPTR,#CHANL2
MOV A,40H
MOVC A,@A+DPTR
ACALL SendByte
MOV DPTR,#CHANL2
MOV A,40H
INC A
MOVC A,@A+DPTR
ACALL SendByte
MOV DPTR,#CHANL2
MOV A,40H
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte
MOV DPTR,#CHANL2
MOV A,