完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
本帖最后由 auqyygtj 于 2014-3-16 18:49 编辑
/************************************************* * 点阵字码表table1 ** * 用于移屏显示 ** **************************************************/ unsigned long int code table1[][16]={ {0xFC,0x3F,0xFE,0x7F,0x06,0x60,0x06,0x60,0x06,0x60,0xFE,0x7F,0xFC,0x3F,0x00,0x00}, //0 {0x00,0x00,0x08,0x40,0x08,0x60,0xFE,0x7F,0xFE,0x7F,0x00,0x60,0x00,0x40,0x00,0x00}, //1 {0x0C,0x78,0x06,0x7C,0x06,0x66,0x06,0x63,0x86,0x61,0xFE,0x70,0x7C,0x70,0x00,0x00},//2 {0x0C,0x30,0x06,0x60,0x82,0x60,0x82,0x60,0xC2,0x61,0x7E,0x3F,0x3C,0x1E,0x00,0x00}, //3 {0xE0,0x0F,0xF0,0x0F,0x18,0x4C,0x0C,0x4C,0xFE,0x7F,0xFE,0x7F,0x00,0x4C,0x00,0x00}, //4 {0xFE,0x30,0xFE,0x60,0xC2,0x60,0xC2,0x60,0xC2,0x61,0x82,0x3F,0x02,0x1F,0x00,0x00}, //5 {0xFC,0x3F,0xFE,0x7F,0x82,0x61,0x82,0x61,0x82,0x61,0x8E,0x7F,0x0C,0x3F,0x00,0x00}, //6 {0x0E,0x00,0x0E,0x00,0x02,0x00,0xC2,0x7F,0xE2,0x7F,0x3E,0x00,0x1E,0x00,0x00,0x00}, //7 {0x7C,0x3C,0xFE,0x7E,0x86,0x63,0x86,0x63,0x86,0x63,0xFE,0x7E,0x7C,0x3C,0x00,0x00}, //8 {0xFC,0x30,0xFE,0x61,0x86,0x61,0x86,0x61,0x86,0x61,0xFE,0x7F,0xFC,0x3F,0x00,0x00}, //9 {0x00,0x00,0x00,0x00,0x38,0x1C,0x3C,0x3C,0x3C,0x3C,0x38,0x1C,0x00,0x00,0x00,0x00}, //10 : {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //11空 {0x00,0x00,0x00,0x00,0x40,0x20,0x42,0x22,0x5E,0x22,0x5C,0x22,0x48,0x22,0x40,0x22}, {0x7F,0x22,0x7F,0x22,0x50,0x22,0x5E,0x22,0x4E,0x22,0xC4,0x7F,0xC0,0x7F,0x00,0x00},//"当",1213/ {0x08,0x00,0x08,0x00,0xE8,0x7F,0xE8,0x7F,0xA9,0x24,0xAF,0x64,0xEE,0x7F,0xEA,0x3F}, {0x08,0x00,0xC8,0x1F,0xCC,0x5F,0x0F,0xC0,0xEB,0xFF,0xEA,0x7F,0x08,0x00,0x08,0x00},//"前",1415/ {0x00,0x00,0xFC,0x07,0xFC,0x07,0x44,0x04,0x44,0x04,0xFC,0x07,0xFC,0x07,0x90,0x00}, {0x90,0x03,0x10,0x43,0x10,0xC0,0xFF,0xFF,0xFF,0x7F,0x10,0x00,0x10,0x00,0x10,0x00},//"时",1617/ {0x00,0x00,0xF8,0xFF,0xF9,0xFF,0x07,0x00,0x06,0x00,0xF0,0x07,0xF2,0x07,0x92,0x04}, {0x92,0x04,0x92,0x04,0xF2,0x07,0xF2,0x47,0x02,0xC0,0xFE,0xFF,0xFE,0x7F,0x00,0x00},//"间",1819/ {0x00,0x00,0x00,0x40,0x00,0x70,0xE0,0x37,0xE0,0x17,0x20,0x72,0x20,0x62,0x3F,0x0A}, {0x3F,0x1A,0x24,0x72,0x24,0x62,0xF4,0x0F,0xF4,0x1F,0x24,0x70,0x00,0x60,0x00,0x00},//"点",2021/ {0x80,0x00,0xC0,0x80,0x60,0xC0,0xB8,0x60,0x9F,0x30,0x87,0x1F,0x82,0x0F,0x80,0x00}, {0x83,0x20,0x87,0x60,0x9C,0x7F,0xB8,0x3F,0x70,0x00,0xE0,0x00,0xC0,0x00,0x40,0x00},//"分",2223/ {0x12,0x04,0x12,0x07,0xD2,0x03,0xFE,0xFF,0xFF,0xFF,0x91,0x83,0xD1,0x83,0xF8,0xC0}, {0x38,0x40,0x10,0x60,0xFF,0x23,0xFF,0x33,0x08,0x18,0x18,0x0C,0x70,0x07,0x60,0x03},//"秒",2425/ {0x00,0x00,0xFE,0xFF,0xFE,0xFF,0x22,0x0C,0x7A,0x0C,0xDE,0x07,0x86,0x03,0xFE,0x3F}, {0xFE,0x3F,0x42,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0xFE,0x3F,0xFE,0x3F,0x00,0x00},//"阳",2627/ {0x00,0x40,0x00,0x70,0xFE,0x3F,0xFE,0x0F,0x22,0x40,0x22,0x60,0x22,0x38,0x22,0x1E}, {0xFA,0x07,0xFA,0x01,0x22,0x20,0x22,0x60,0xE2,0x7F,0xE2,0x3F,0x02,0x00,0x02,0x00},//"历",2829/ {0x40,0x00,0x40,0x00,0x40,0x00,0x5F,0x02,0xDF,0x07,0xD1,0x07,0x51,0x02,0x51,0x22}, {0x51,0x62,0x51,0xC2,0x51,0xC2,0x5F,0x7E,0x5F,0x3E,0x40,0x00,0x40,0x00,0x40,0x00},//"号",3031/ {0x00,0x00,0x00,0x48,0x00,0x4E,0xBE,0x47,0xBE,0x49,0x2A,0x49,0x2A,0x49,0xEA,0x7F}, {0xEA,0x7F,0x2A,0x49,0x2A,0x49,0x2A,0x49,0x3E,0x49,0x3E,0x49,0x00,0x41,0x00,0x40},//"星",3233/ {0x00,0x42,0x04,0x62,0xFF,0x3B,0xFF,0x1B,0x54,0x02,0x54,0x0A,0xFF,0x3B,0xFF,0x73}, {0x04,0x7A,0xFE,0x1F,0xFE,0x07,0x22,0x22,0x22,0x62,0xFE,0x7F,0xFE,0x3F,0x00,0x00},//"期",3435/ }; #define NL 11 //空格地址 uchar xdata LED_RAM[]; /**************************************显示缓冲区*/ /***************滚动显示格式数组***********************************/ uchar xdata G[43]= //显示格式 { NL,NL,NL,NL,NL, //开头5个空格 0-4 12,13,14,15,16,17,18,19, //当前时间56789101112 00,00, //时数据1314 20,21, //点1516 00,00, //分数据1718 22,23, //分1920 00,00, //秒数据2122 24,25,26,27,28,29, //秒阳历232425262728 00,00, //号数据2930 30,31,32,33,34,35, //号星期 313233343536 00, //星期数据37 NL,NL,NL,NL,NL, // 空5个3839404142 }; //……………………………………………………………… void NYRLoad(void) { read_time(&time); //读取数据 G[13]=shi/10; //小时十位 G[14]=shi%10; //小时个位 G[17]=fen/10; //分钟十位 G[18]=fen%10; //分钟个位 G[21]=miao/10; //秒十位 G[22]=miao%10; //秒个位 G[29]=hao/10; //号十位 G[30]=hao%10; //号个位 G[37]=xiqi%10; //星期个位 } //…………………………以下是移屏显示…………………… void Adisplay() { uchar ds; for(i=0;i<8;i++) //共8行,逐行扫描 { for(ds=0;ds<8;ds++) { P4=i;//给74HC138的数据口送数据,逐一选中各行, OEB=1;//打开使能端 P0=table1[j+b];//给上8行送数据,刚开始j和b都第一样的,当a满足条件时b就变化了 delay(3);//延时消影 P0=0; //消影 OEB=0;//关闭使能端 OEA=1;//打开使能端 P0=table1[j+b+1];//给下8行送数据,刚开始j和b都第一样的,当a满足条件时b就变化了 delay(3);//延时消影, P0=0; //消影, OEA=0; //关闭使能端 j+=2; //j=j+2,第一次j取第1位编,下次就得取第3位编码了,因为字库排序是奇数是上8行,偶数是下8行的编码 } } } //………………………………………………………………………… 那个高手帮忙高整修改下哇! |
|
相关推荐
1个回答
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
《DNESP32S3使用指南-IDF版_V1.6》第十一章 KEY实验
46 浏览 0 评论
355 浏览 0 评论
352 浏览 1 评论
飞凌嵌入式-ELFBOARD-ELF 2硬件知识分享-最小系统原理
444 浏览 0 评论
826 浏览 1 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
11929 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-11 18:29 , Processed in 0.445266 second(s), Total 41, Slave 35 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号