跪求16*16点阵C程序,显示“科技改变生活”六字,由于刚刚学习单片机,程序最好有文字注明!谢谢!
#include unsigned char code tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe}; //控制列,P2控制,低电平显示unsigned char code digittab[10][8]={{0x00,0x00,0x3e,0x41,0x41,0x41,0x3e,0x00}, //0控制行,P0控制,高电平显示,八行十个数字{0x00,0x00,0x00,0x00,0x21,0x7f,0x01,0x00}, //1{0x00,0x00,0x27,0x45,0x45,0x45,0x39,0x00}, //2{0x00,0x00,0x22,0x49,0x49,0x49,0x36,0x00}, //3{0x00,0x00,0x0c,0x14,0x24,0x7f,0x04,0x00}, //4{0x00,0x00,0x72,0x51,0x51,0x51,0x4e,0x00}, //5{0x00,0x00,0x3e,0x49,0x49,0x49,0x26,0x00}, //6{0x00,0x00,0x40,0x40,0x40,0x4f,0x70,0x00}, //7{0x00,0x00,0x36,0x49,0x49,0x49,0x36,0x00}, //8{0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00} //9};unsigned int time;unsigned char a,b;sbit duan=P3^6;//数码管段显示sbit wei=P3^7;//数码管位显示/***************************************/ /* 主程序 */ /***************************************/void main(void){ duan=1; P0=0X00; duan=0; //关闭数码管段显示 wei=1; //数码管位显示,,点阵行控制TMOD=0x01;//初装中断值TH0=(65536-3000)/256;TL0=(65536-3000)%256;TR0=1;ET0=1;EA=1;while(1) {;}}/***************************************/ /* 中断子程序 */ /***************************************/ void t0(void) interrupt 1 using 0 //中断{TH0=(65536-3000)/256;TL0=(65536-3000)%256;P2=tab[a]; //共阳点阵,P2控制低电平,P0控制高电平P0=digittab[b][a];//P0控制锁存器74HC573输出高电平控制行 a++;if(a==8){ a=0;} time++;if(time==233){ time=0; b++;if(b==10){ b=0;}}}
你好!这样的效果可以吗
#define BLKN 2 //列锁存器
sbit G=P1^7; //P1.7为显示允许控制信号端口
sbit RRCLK=P1^6; //P1.6为输出锁存器时钟信号端
sbit SCLR=P1^5; //P1.5为移为寄存器清零端
void delay(unsigned int); //延时函数
unsigned char data dispram[32]; //显示缓存
unsigned char data huancun[32];
void main(void)
{ unsigned char code Cmp[][32]={
{0xff,0x07,0xc0,0x6f,0xed,0xef,0xf6,0xdf,0xc0,
0x01,0xdd,0xfd,0xbd,0xff,0xc0,0x03,
0xfb,0xff,0xf8,0x0f,0xf3,0xdf,0xf4,0xbf,0xef,
0x3f,0x9c,0xcf,0x73,0xf1,0xcf,0xfb},//爱
{0xf7,0xdf,0xf9,0xcf,0xfb,0xbf,0xc0,0x07,0xde,
0xf7,0xc0,0x07,0xde,0xf7,0xde,0xf7,
0xc0,0x07,0xde,0xf7,0xfe,0xff,0x00,0x01,0xfe,
0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff},//单
{0xff,0xbf,0xef,0xbf,0xef,0xbf,0xef,0xbb,0xe0,
0x01,0xef,0xff,0xef,0xff,0xef,0xff,
0xe0,0x0f,0xef,0xef,0xef,0xef,0xef,0xef,0xdf,
0xef,0xdf,0xef,0xbf,0xef,0x7f,0xef},//片
{0xef,0xff,0xef,0x07,0xef,0x77,0x01,0x77,0xef,
0x77,0xef,0x77,0xc7,0x77,0xcb,0x77,
0xab,0x77,0xaf,0x77,0x6e,0xf7,0xee,0xf5,0xed,
0xf5,0xed,0xf5,0xeb,0xf9,0xef,0xff},//机
{0xf8,0x3f,0xe7,0xcf,0xdf,0xf7,0xbf,0xfb,0xb3,
0x9b,0x73,0x9d,0x7f,0xfd,0x7f,0xfd,
0x6f,0xed,0x67,0xcd,0xb3,0x9b,0xb8,0x3b,0xdf,
0xf7,0xe7,0xcf,0xf8,0x3f,0xff,0xff},//笑脸
{0xf9,0xbf,0xc7,0xaf,0xf7,0xb7,0xf7,0xb7,0xf7,
0xbf,0x00,0x01,0xf7,0xbf,0xf7,0xb7,
0xf1,0xd7,0xc7,0xcf,0x37,0xdf,0xf7,0xaf,0xf6,
0x6d,0xf7,0xf5,0xd7,0xf9,0xef,0xfd}};//我
unsigned char code Bmp[][32]={
{0xf9,0xbf,0xc7,0xaf,0xf7,0xb7,0xf7,0xb7,0xf7,
0xbf,0x00,0x01,0xf7,0xbf,0xf7,0xb7,
0xf1,0xd7,0xc7,0xcf,0x37,0xdf,0xf7,0xaf,0xf6,
0x6d,0xf7,0xf5,0xd7,0xf9,0xef,0xfd},//我
{0xff,0x07,0xc0,0x6f,0xed,0xef,0xf6,0xdf,0xc0,
0x01,0xdd,0xfd,0xbd,0xff,0xc0,0x03,
0xfb,0xff,0xf8,0x0f,0xf3,0xdf,0xf4,0xbf,0xef,
0x3f,0x9c,0xcf,0x73,0xf1,0xcf,0xfb},//爱
{0xf7,0xdf,0xf9,0xcf,0xfb,0xbf,0xc0,0x07,0xde,
0xf7,0xc0,0x07,0xde,0xf7,0xde,0xf7,
0xc0,0x07,0xde,0xf7,0xfe,0xff,0x00,0x01,0xfe,
0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff},//单
{0xff,0xbf,0xef,0xbf,0xef,0xbf,0xef,0xbb,0xe0,
0x01,0xef,0xff,0xef,0xff,0xef,0xff,
0xe0,0x0f,0xef,0xef,0xef,0xef,0xef,0xef,0xdf,
0xef,0xdf,0xef,0xbf,0xef,0x7f,0xef},//片
{0xef,0xff,0xef,0x07,0xef,0x77,0x01,0x77,0xef,
0x77,0xef,0x77,0xc7,0x77,0xcb,0x77,
0xab,0x77,0xaf,0x77,0x6e,0xf7,0xee,0xf5,0xed,
0xf5,0xed,0xf5,0xeb,0xf9,0xef,0xff},//片
{0xf8,0x3f,0xe7,0xcf,0xdf,0xf7,0xbf,0xfb,0xb3,
0x9b,0x73,0x9d,0x7f,0xfd,0x7f,0xfd,
0x6f,0xed,0x67,0xcd,0xb3,0x9b,0xb8,0x3b,0xdf,
0xf7,0xe7,0xcf,0xf8,0x3f,0xff,0xff},//笑脸
};
register unsigned char i,j,k,m,l;
SCON=0x00; //串口工作模式0,移位寄存器方式
TMOD=0x01; //定时器T0工作方式1;16位方式
TR0=1; //启动定时器T0
P1=0x3f; //P1端口初值,允许接收,缓存,显示
IE=0x82; //允许定时器T0中断
while(1)
{
delay(1000);
for(i=0;i<32;i++) //显示效果:卷帘出
{
dispram[i]=Bmp[5][i];
huancun[i]=Cmp[4][i];
if(i%2)delay(70);
}
delay(100);
for(i=0;i<6;i++) //显示效果:上滚屏
{
for(j=0;j<16;j++)
{
for(k=0;k<15;k++)
{
huancun[k*BLKN]=huancun[(k+1)*BLKN];
huancun[k*BLKN+1]=huancun[(k+1)*BLKN+1];
dispram[k*BLKN]=dispram[(k+1)*BLKN];
dispram[k*BLKN+1]=dispram[(k+1)*BLKN+1];
}
huancun[30]=Bmp[i][j*BLKN];
huancun[31]=Bmp[i][j*BLKN+1];
dispram[30]=Bmp[i][j*BLKN];
dispram[31]=Bmp[i][j*BLKN+1];
delay(70);
}
}
delay(1000);
for(i=0;i<32;i++) //显示效果:卷帘出
{
dispram[i]=Bmp[5][i];
huancun[i]=Cmp[5][i];
if(i%2)delay(70);
}
for(i=0;i<6;i++) //显示效果,做跑马
{
for(j=0;j<2;j++)
for(k=1;k<9;k++)
{
for(l=0;l<16;l++)
{ huancun[l*BLKN]=huancun[l*BLKN]<<1|huancun[l*BLKN+1]>>7;
huancun[l*BLKN+1]=huancun[l*BLKN+1]<<1|Cmp[i][l*BLKN+j]>>(8-k);
dispram[l*BLKN]=dispram[l*BLKN]<<1|dispram[l*BLKN+1]>>7;
dispram[l*BLKN+1]=dispram[l*BLKN+1]<<1|Bmp[i][l*BLKN+j]>>(8-k);
}
delay(70);
}
}
delay(1000);
for(i=0;i<32;i++) //显示效果:卷帘出
{
dispram[i]=Bmp[5][i];
huancun[i]=Cmp[4][i];
if(i%2)delay(70);
}
for(i=1;i<7;i++) //显示效果:向下滚滚屏
{
for(j=16;j>0;j--)
{
for(k=15;k>0;k--)
{ huancun[k*BLKN]=huancun[(k-1)*BLKN];
huancun[k*BLKN+1]=huancun[(k-1)*BLKN+1];
dispram[k*BLKN]=dispram[(k-1)*BLKN];
dispram[k*BLKN+1]=dispram[(k-1)*BLKN+1];
}
huancun[0]=Bmp[i-1][(j-1)*BLKN];
huancun[1]=Bmp[i-1][(j-1)*BLKN+1];
dispram[0]=Bmp[i-1][(j-1)*BLKN];
dispram[1]=Bmp[i-1][(j-1)*BLKN+1];
delay(70);
}
}
delay(1000);
for(i=0;i<6;i++) //显示效果,又跑马
{
for(j=2;j>0;j--)
for(k=1;k<9;k++)
{
for(l=0;l<16;l++)
{
for(m=0;m<32;m++) //显示效果:卷帘出
{
dispram[m]=Bmp[5][m];
}
huancun[l*BLKN+1]=huancun[l*BLKN+1]>>1|huancun[l*BLKN]<<7;
huancun[l*BLKN]=huancun[l*BLKN]>>1|Bmp[i][l*BLKN+j-1]<<(8-k);
//dispram[l*BLKN+1]=dispram[l*BLKN+1]>>1|dispram[l*BLKN]<<7;
//dispram[l*BLKN]=dispram[l*BLKN]>>1|Bmp[i][l*BLKN+j-1]<<(8-k);
}
delay(70);
}
}
delay(1000);
for(i=0;i<32;i++) //显示效果:眷恋入
{
huancun[i]=0x00;
dispram[i]=0x00;
if(i%2)delay(70);
}
}
}
//延时函数
void delay(unsigned int dt)
{
register unsigned char bt;
for(;dt;dt--)
for(bt=0;bt<255;bt++);
}
//显示屏扫描(定时器T0中断)函数
void leddisplay(void)interrupt 1 using 1
{
register unsigned char i,j=BLKN;
TH0=0Xf8; //设定显示屏刷新率每秒62.5
TL0=0X30;
i=P1; //读取当前显示的行号
i=++i&0x0f; //行号加一,屏蔽高四位
do {
j--;
SBUF=huancun[i*BLKN+j]; //送显示数据
while(!TI);TI=0;
}while(j);j=2;
do {
j--;
SBUF=dispram[i*BLKN+j]; //送显示数据
while(!TI);TI=0;
}while(j);
//完成一行数据的发送
G=1; //消隐(关闭显示)
P1&=0xf0; //行号端口清零
RRCLK=1; //显示数据打入输出锁存器
P1|=i;
//写入行号
RRCLK=0; //所存显示数据
G=0;
//打开显示
}
你参考吧希望对你有帮助,行驱动也是74HC154,列是74HC595
急急急。。。跪求16x16点阵模块显示汉字的C语言程序
ulong column; \/\/点阵列 ulong row; \/\/点阵行 ulong dt;\/\/点阵显示数组 uchar code tab0[] = {0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80,0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x...
用单片机实现16*16点阵显示,要用C语言编写程序+注释,顺便还要原理图,能...
1.字符串没加结束标志'\\0'2. else if(ns>=n&&nt<n)for(i=0;i<n;i++){m1[i]=s[i];strcat(m1,t);strcpy(s,m1);} 这段错误 include"iostream.h"include"string.h"include"stdio.h"void mystrcat(char s[],char t[],int n){ char m1[100],m2[100];int i,ns,nt;ns=strlen...
汉字16×16点阵是多少字节的内存?
一个16×16的位图需要32字节或256位存储。一个点需要1位二进制码,16个点需要16位二进制码(即2个字节),共16行;因此,16行×2字节/行=32字节,即16×16点阵表示一个汉字,字形代码为32字节。
一个汉字的16*16点阵字形码长度的字节数是?
一个汉字的16X16点阵字形码长度的字节数是C A.16 B.24 C.32 D.40 每个点阵用一个0或1代替,需要16X16个0或1,因为8个二进制位为1个字节,换算成字节数就除以8,得到32.
我想编写16*16点阵的左移程序。用C语言,51单片机。你能否帮我编一个小...
{ for(n=0;n<32;n++) \/\/ for(m=0;m<8;m++) \/\/重复显示8次 { temp=0;\/\/ 不加此条,流动飞快 for(num=n;num<16+n;num++){ WriteByte(tab[2*num+1]);WriteByte(tab[2*num+0]);P1=temp;ST_CP=0;ST_CP=1;delay_ms(1);temp++;if(temp==16)temp=0;} } } } ...
求一个程序 这个161*161的点阵动态显示出来 要c语言程序
先说第一个154方案的:用一个P口的高四位和低四位分别驱动两片154驱动点阵的行和列,另外你还要在点阵的低电平端的驱动154的输出端加八位反向器。如果我没记错的话,154的输出只有一位是高电平,要反向成唯一低电平。你第两个我没有太明白,你是要用二个P口只控制16*16的列吗,那行由谁控制...
用16×16点阵存储一个汉字的字形码,需要用多少个字节
需要用( )A.16个字节 B.32个字节 C.64个字节 D.256个字节 查看答案解析 正确答案: B 校名师权威解析: 16×16汉字点阵有16×16=256位二进制位来表示一个汉字的字形码。在计算机中,一个字节由8位二进制位组成。故一个16×16点阵的字形码需以256位\/8位=32字节的存储空间存储。
在16×16点阵的汉字字库中,存储一个汉字的字模所占的字节数为?_百度知 ...
绚丽,但不实用),即多个比特(bit)表示一个点(像素)。点阵字库是指多个 (>=1) 字符的点阵信息的集合,亦可理解为位图组合。在16×16点阵字库中,有16×16即256个比特(bit),而在计算机中一个字节是8比特(bit),所以存储一个汉字的字模信息需用的字节数是256÷8=32个字节。
求用C语言制作16*16点阵显示汉字的原理图 仿真图和程序发
就好像二极管显示汉字一样,发亮的二极管组成一个汉字。那么你要显示一个汉字首先你应该知道哪些二极管应该发亮。同样16*16点阵,一个而为数组,里面吗保存0或1,然后遍历啊,碰到1输出'.',碰到0则输出空格。关键是这个字符显示编码,可以到网上搜,也可以自己做 ...
...单片机C语言编写程序,使液晶显示器显示16*16点阵汉字,请问怎么编写...
{ P1=i;P2=led[32*j+2*i];P3=led[32*j+2*i+1];delay();i++;if(i==16)i=0;if(time_50ms==20){ time_50ms=0;j++;if(j==2)j=0;} } } int_T0() interrupt 1 { TH0=0X3C;TL0=0XB0;time_50ms++;} delay(){ unsigned char t1;for(t1=0;t1<100;t1++);} ...
子尹小儿: 问题:1.字符串没加结束标志'\0'2. else if(ns>=n&&nt<n) for(i=0;i<n;i++) {m1[i]=s[i]; strcat(m1,t); strcpy(s,m1); } 这段错误#include"iostream.h"#include"string.h"#include"stdio.h" void mystrcat(char s[],char t[],int n) { char m1[100],m2[100]; int...
魏都区15760176950: 设计一个16*16的点阵的代码,c语言的 - ?
子尹小儿: 很简单啊 #include<stdio.h> void main() {int i,j;for(i=0;i<16;i++){ for(j=0;j<16;j++)printf(" * ");printf("\n");} }
魏都区15760176950: 滚动字幕c语言编程求一个16*16的LED点阵屏滚动字幕的C语言程序 - ?
子尹小儿: 这算是单片机上应用吧. 先要看LED点阵屏所需参数(驱动,速度,点阵显示汉字串口),这个看懂了也就会了.当然先要会C语言 要是不会,直接用那就找差不多的改. http://blog.163.com/heaphone2010@126/blog/static/1684254352010112693739548/ 这里有一个16*128的.
魏都区15760176950: 16*16点阵LED显示 C语言程 74HC154 - ?
子尹小儿: 当初的读点阵显示汉字的程序: int out16hz(int x, int y, int color, char *p) {Word i, QM, WM, f=0;int record, i1, i2, i3;long pointer;char Bit[32];while ((i=*p++) != 0){if (f == 0){if (i < 128) /*显示ascii码*/{pointer = i * 16L;lseek(flagasc, pointer, ...
魏都区15760176950: 如何用c语言写16*16点阵显示汉字的程序 - ?
子尹小儿: 楼主没说清楚啊,你是用点阵led还是用lcd,用lcd的话支不支持汉字库.如果是用led就自己把汉字图像一行一行的发过去,不支持字库的lcd,设置lcd为图像模式,按图像发过去,支持...
魏都区15760176950: 16 16点阵c语言字模 - ?
子尹小儿: 点阵大小:16 * 16 汉字点阵:(宋体) [王] 0x00,0x00,0x00,0x00,0x00,0x04,0x3f,0xf8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x1f,0xf8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x82,0x7f,0xfe,0x00,0x00[官] 0x00,0x00,0x01,0x00,0x20,...
魏都区15760176950: 你好,谢谢,我完善一下,主芯片类型89c51采用四个74hc595作为16*16点阵显示芯片,采用c语言编程, - ?
子尹小儿: 关键程序如下:uint arr[]={ 0x7fff,0xffff,0xffff,0xffff},*p=arr ;void delay (void) {TMOD=0X01;TR0=1;TH0=0X63;TL0=0X18;while(!TF0);TF0=0;TR0=0; }void ST595(void) {ST=0;_nop_();_nop_();ST=1;_nop_();_nop_();ST=0; }void ...
魏都区15760176950: 求一款51单片机16*16点阵显示静态汉字的C例程 - ?
子尹小儿: #include<reg52.h> //包含头文件 #define uint unsigned int //预定义一下 #define uchar unsigned char sbit rs=P3^5; //1602的数据/指令选择控制线 sbit rw=P3^6; //1602的读写控制线 sbit en=P3^7; //1602的使能控制线 /*P2口接1602的D0~D7,注意...
魏都区15760176950: 求16x16点阵C程序 - ?
子尹小儿: /*************** 点阵字模工具编程辅助效果示例 ***************/ /************************************************************************ 该示例中的字模数组均由“点阵字模工具”生成,你可以用你自己需要的点阵信息来 替换示例中的字模信息,注意字模大...
魏都区15760176950: 16*16点阵显示 - ?
子尹小儿: ;16X16LED点阵流动显示 ;逐列、逆向(低位开始)扫描 ORG 0000H AJMP MAIN ORG 0030H MAIN: MOV DPTR,#TAB ;字码表初址