完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
`#include"reg51.h" #include"intrins.h" #define NOP() _nop_() typedef unsigned char u8; typedef unsigned int u16; #define uchar unsigned char #define uint unsigned int #define ulong unsigned long ***it MOSIO = P3^4; ***it R_CLK = P3^5; ***it S_CLK = P3^6; 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, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80, 0x00}; uchar code tab1[] = /*-- 文字: 张 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ { 0x02,0xE2,0x22,0x22,0x3E,0x80,0x80,0xFF,0x80,0xA0,0x90,0x88,0x86,0x80,0x80,0x00, 0x00,0x43,0x82,0x42,0x3E,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x10,0x20,0x40,0x00, }; uchar code tab2[] = { /*-- 文字: 瑞 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ 0x84,0x84,0xFC,0x84,0x84,0x40,0x5E,0x50,0x50,0x50,0xDF,0x50,0x50,0x50,0x5E,0x00, 0x10,0x30,0x1F,0x08,0x08,0x00,0xFE,0x02,0x02,0x7F,0x02,0x7E,0x02,0x82,0xFE,0x00, }; uchar code tab3[] = { /*-- 文字: 曦 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ 0xFC,0x84,0x84,0xFC,0x00,0x22,0xAA,0xAB,0xAA,0xBE,0x2A,0xAB,0x2A,0xA2,0x00,0x00, 0x3F,0x10,0x10,0x3F,0x00,0x0A,0x56,0x9F,0x72,0x06,0x0A,0x4F,0x32,0x5A,0xE3,0x00, }; uchar code tab4[]= { /*-- 文字: 生 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ 0x80,0x40,0x30,0x1E,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00, 0x40,0x40,0x42,0x42,0x42,0x42,0x42,0x7F,0x42,0x42,0x42,0x42,0x42,0x40,0x40,0x00, }; uchar code tab5[]= { /*-- 文字: 日 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ 0x00,0x00,0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xFF,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x00,0x00,0x00,0x00, }; uchar code tab6[]= { /*-- 文字: 快 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ 0x00,0xE0,0x00,0xFF,0x10,0x20,0x08,0x08,0x08,0xFF,0x08,0x08,0xF8,0x00,0x00,0x00, 0x01,0x00,0x00,0xFF,0x00,0x81,0x41,0x31,0x0D,0x03,0x0D,0x31,0x41,0x81,0x81,0x00, }; uchar code tab7[]= { /*-- 文字: 乐 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ 0x00,0x00,0xE0,0x9C,0x84,0x84,0x84,0xF4,0x82,0x82,0x83,0x82,0x80,0x80,0x00,0x00, 0x00,0x20,0x10,0x08,0x06,0x40,0x80,0x7F,0x00,0x00,0x02,0x04,0x08,0x30,0x00,0x00, }; void HC595SendData( uchar BT3,uchar BT2,uchar BT1,uchar BT0); void main(void) { int k,i,ms; i=80; while(1) { for(ms=i;ms>0;ms--) { for(k=0;k<16;k++) { HC595SendData(~tab1[2*k+1],~tab1[2*k],tab0[2*k],tab0[2*k+1]); } } HC595SendData(0xff,0xff,0,0); for(ms=i;ms>0;ms--) { for(k=0;k<16;k++) { HC595SendData(~tab2[2*k+1],~tab2[2*k],tab0[2*k],tab0[2*k+1]); } } HC595SendData(0xff,0xff,0,0); for(ms=i;ms>0;ms--) { for(k=0;k<16;k++) { HC595SendData(~tab3[2*k+1],~tab3[2*k],tab0[2*k],tab0[2*k+1]); } } HC595SendData(0xff,0xff,0,0); for(ms=i;ms>0;ms--) { for(k=0;k<16;k++) { HC595SendData(~tab4[2*k+1],~tab4[2*k],tab0[2*k],tab0[2*k+1]); } } HC595SendData(0xff,0xff,0,0); for(ms=i;ms>0;ms--) { for(k=0;k<16;k++) { HC595SendData(~tab5[2*k+1],~tab5[2*k],tab0[2*k],tab0[2*k+1]); } } HC595SendData(0xff,0xff,0,0); for(ms=i;ms>0;ms--) { for(k=0;k<16;k++) { HC595SendData(~tab6[2*k+1],~tab6[2*k],tab0[2*k],tab0[2*k+1]); } } HC595SendData(0xff,0xff,0,0); for(ms=i;ms>0;ms--) { for(k=0;k<16;k++) { HC595SendData(~tab7[2*k+1],~tab7[2*k],tab0[2*k],tab0[2*k+1]); } } HC595SendData(0xff,0xff,0,0); } } void HC595SendData(uchar BT3,uchar BT2,uchar BT1,uchar BT0) { uchar i; for(i=0;i<8;i++) { MOSIO =BT3>>7; BT3<<=1; S_CLK =0; S_CLK =1; } for(i=0;i<8;i++) { MOSIO =BT2>>7; BT2<<=1; S_CLK =0; S_CLK =1; } for(i=0;i<8;i++) { MOSIO =BT1>>7; BT1<<=1; S_CLK =0; S_CLK =1; } for(i=0;i<8;i++) { MOSIO =BT0>>7; BT0<<=1; S_CLK =0; S_CLK =1; } R_CLK = 0; R_CLK = 1; R_CLK = 0; } ` |
|
相关推荐
10个回答
|
|
字库问题,或者,字库提取的问题
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
乱码一般都是段位引起的,仔细检查一下段位,看看是哪里接错线了。
|
|
|
|
这是我程序图跟接线图,应该没问题,您方便的话能不能加一下我的qq1115354533 |
|
|
|
你是在原来的程序上修改的?就是自己改 了库吗?
|
|
|
|
我自己改的程序,弄好了,我现在不明白的是为啥10进制能显示,16进制不能显示 |
|
|
|
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
求解外围电路实现的是4脚给持续低电平复位并正常工作,高电平不工作的原因
2077 浏览 1 评论
3508 浏览 3 评论
PIC1946程序有一个变量在运行过程中恢复初始值其他变量保持不变
2334 浏览 2 评论
2761 浏览 0 评论
PIC16F1825的RC5引脚,在主程序中操作无效,在中断中可以改变是为什么?
4019 浏览 5 评论
968浏览 0评论
用XC8编译PIC18F25K80时提示下面Error,求怎么解决这个问题
6351浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 15:01 , Processed in 0.840923 second(s), Total 101, Slave 81 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号