完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
#include
#include "display.h" #define FOSC 12 //定义晶振频率 #define INIT_TH0 0x3C //定时器T0初始值 #define INIT_TL0 0xB0 #define TMOD_T00 0x00 //定义T0为方式0,GATE=0,C/T=0,13位计数器 #define TMOD_T01 0x01 //定义T0为方式1,GATE=0,C/T=0,16位计数器 #define TMOD_T02 0x02 //定义T0为方式2,GATE=0,C/T=0,自动装入8位计数器 #define TMOD_T03 0x03 //定义T0为方式3,GATE=0,C/T=0,定时器0分成两个8位计数器,定时器1停止计数 /*缩写定义*/ #define uchar unsigned char #define uint unsigned int /************位定义***************/ ***it STTP = P2^7; /************函数声明*************/ void delay(uint c); //延时函数 void out_rxd(uchar *d); //汉字输出 /************主函数***************/ void main() { uchar i,j,k; //i:每个字的显示循环;j每个字的显示码除以2;k每列刷新次数 uint b=0; //显示偏移控制,char类型最多只能显示14个汉字+一个空白位字符 uchar a; //控制移动间隔时间 SCON = 0; while(1) { j=0; if(a>1) //移动间隔时间;取值0--255 { a=0; b+=2; if(b>=320) //显示到最后一个字,回头显示,判断值=字数*32 { b=0; } } for(i=0;i<16;i++) { P1=i; STTP = 0; for(k=4;k>0;k--) { out_rxd(&hanzi[k][j+b+1]); out_rxd(&hanzi[k][j+b]); } STTP = 1; delay(15); j=j+2; } a++; } } /************子函数**************/ void delay(uint c) { int i,j; for(i=0;i } void out_rxd(uchar *d) { SBUF = *d; //启动串行口传送 while(ti==0); //等待串口传送结束 TI = 0; //将串口中断标志位置0 } char code hanzi[32][32]={ {//空 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x07,0x00,0x08,0x80,0x10,0x40,0x20,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02, 0x04,0x02,0x08,0x04,0x10,0x08,0x20,0x10,0x20,0x20,0x10,0x40,0x08,0x80,0x07,0x00},/*"未命名文件",0*/ {0x07,0x00,0x08,0x80,0x10,0x40,0x20,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02, 0x04,0x02,0x08,0x04,0x10,0x08,0x20,0x10,0x20,0x20,0x10,0x40,0x08,0x80,0x07,0x00},/*"未命名文件",0*/ {0x07,0x00,0x08,0x80,0x10,0x40,0x20,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02, 0x04,0x02,0x08,0x04,0x10,0x08,0x20,0x10,0x20,0x20,0x10,0x40,0x08,0x80,0x07,0x00},/*"未命名文件",0*/ {0x02,0x01,0x42,0x02,0x33,0xFC,0x00,0x02,0x00,0x01,0x47,0xFF,0x44,0x91,0x54,0x91, 0x54,0x91,0x4F,0xFD,0x54,0x91,0x64,0x95,0x44,0x93,0x07,0xFD,0x00,0x01,0x00,0x00},/*"通",0*/ {0x00,0x80,0x01,0x00,0x06,0x00,0x1F,0xFF,0xE0,0x00,0x00,0x00,0x20,0x00,0x24,0x9F, 0x24,0x92,0xA4,0x92,0x64,0x92,0x24,0x92,0x24,0x92,0x24,0x9F,0x20,0x00,0x00,0x00},/*"信",0*/ {0x08,0x20,0x08,0x22,0x08,0x41,0xFF,0xFE,0x08,0x80,0x09,0x01,0x10,0x01,0x11,0x02, 0x11,0xC2,0x11,0x34,0xFF,0x08,0x11,0x14,0x11,0x62,0x11,0x81,0x10,0x01,0x00,0x00},/*"技",0*/ {0x00,0x08,0x08,0x10,0x08,0x20,0x08,0x40,0x08,0x80,0x0B,0x00,0x0C,0x00,0xFF,0xFF, 0x0C,0x00,0x0B,0x00,0x48,0x80,0x38,0x40,0x08,0x20,0x08,0x10,0x00,0x08,0x00,0x00},/*"术",0*/ {0x00,0x00,0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00},/*"1",2*/ {0x00,0x00,0x0C,0x18,0x10,0x04,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"3",3*/ {0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"-",0*/ {0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x10,0x84,0x0F,0x0C,0x00,0x00},/*"2",1*/ {0x21,0x08,0x21,0x0C,0x3F,0xF8,0x21,0x10,0x21,0x11,0x00,0x42,0x1F,0x84,0x00,0x18, 0xFF,0xE0,0x00,0x00,0x21,0x04,0x21,0x04,0x3F,0xFC,0x21,0x04,0x21,0x04,0x00,0x00},/*"班",0*/ {0x02,0x00,0x0A,0x00,0x72,0x7C,0x12,0x40,0x12,0x40,0xFF,0xFF,0x12,0x48,0x12,0x44, 0x12,0x78,0x02,0x00,0x1F,0xF0,0x00,0x02,0x00,0x01,0xFF,0xFE,0x00,0x00,0x00,0x00},/*"制",0*/ {0x00,0x80,0x01,0x00,0x06,0x00,0x1F,0xFF,0xE0,0x00,0x02,0x00,0x0C,0x00,0xF0,0x00, 0x1F,0xFF,0x11,0x10,0x11,0x10,0x11,0x10,0x11,0x10,0x10,0x10,0x10,0x00,0x00,0x00},/*"作",1*/ };数组定义 |
|
相关推荐
1个回答
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
205 浏览 0 评论
求助一下关于51系列单片机的Timer0的计时问题,TH0、TL0+1的时间是怎么算的?
1253 浏览 1 评论
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】开箱+Keil环境搭建+点灯+点亮OLED
848 浏览 0 评论
【敏矽微ME32G070开发板免费体验】使用coremark测试敏矽微ME32G070 跑分
853 浏览 0 评论
【敏矽微ME32G070开发板免费体验】开箱+点灯+点亮OLED
1073 浏览 2 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
12010 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 20:31 , Processed in 0.536202 second(s), Total 71, Slave 53 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号