完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include
#include<74HC595.h> #define uchar unsigned char #define uint unsigned int #define h sizeof(table_H) //列扫描数组 uchar code table_L[]={0xff,0x7f, 0xff,0xbf, 0xff,0xdf, 0xff,0xef, 0xff,0xf7, 0xff,0xfb, 0xff,0xfd, 0xff,0xfe, 0x7f,0xff, 0xbf,0xff, 0xdf,0xff, 0xef,0xff, 0xf7,0xff, 0xfb,0xff, 0xfd,0xff, 0xfe,0xff}; //字模数组 uchar code table_H[]={ 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, //uchar code table_H[] = {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, 0x04,0x28,0x08,0x24,0x32,0x22,0xC2,0x21,0xC2,0x26,0x34,0x38,0x04,0x04,0x08,0x18,0x30,0xF0,0xC0,0x17,0x60,0x10,0x18,0x10,0x0C,0x14,0x06,0x18,0x04,0x10,0x00,0x00, 0x02,0x02,0x04,0x82,0xF8,0x73,0x04,0x20,0x02,0x00,0xE2,0x3F,0x42,0x20,0x82,0x40,0x02,0x40,0xFA,0x3F,0x02,0x20,0x42,0x20,0x22,0x20,0xC2,0x3F,0x02,0x00,0x00,0x00, 0x00,0x01,0x04,0x02,0x1C,0x0C,0xC0,0x3F, 0x1C,0xC0,0x02,0x09,0x02,0x16,0x92,0x60, 0x4A,0x20,0x82,0x2F,0x02,0x20,0x0E,0x24, 0x00,0x22,0x90,0x31,0x0C,0x20,0x00,0x00,/*"您",2*/ 0x00,0x00,0x0E,0xFC,0xEA,0x08,0xAA,0x08, 0xAA,0xE8,0xAA,0xA8,0xAC,0xA8,0xAA,0xA8, 0xAA,0xA8,0xAA,0xA8,0xEA,0xE8,0xAA,0xA8, 0x0C,0x08,0x08,0x08,0x08,0x28,0x08,0x10, 0x04,0x80,0x0E,0xA0,0x78,0x90,0x08,0x90,0x08,0x84,0xFF,0xFE,0x08,0x80,0x08,0x90, 0x0A,0x90,0x0C,0x60,0x18,0x40,0x68,0xA0,0x09,0x20,0x0A,0x14,0x28,0x14,0x10,0x0C, }; uchar L=0,H=0; uint t=0,x=0; void main() { // extern uint h; EA=1; ET0=1; TMOD=0x01; TH0=(65536-1000)/256;//1ms进一次中断刷新显示一列 TL0=(65536-1000)%256; TR0=1; // h=sizeof(table_H); while(1) { if(L==32) { L=0; H=0; } } } void T0_time() interrupt 1 { TH0=(65536-1000)/256; TL0=(65536-1000)%256; Input(table_L[L]); Input(table_L[L+1]); Input(table_H[H+x]); Input(table_H[H+x+1]); Output(); L=L+2; if(L==32)L=0; H=H+2; if(H==32)H=0; t++; if(t==100)//移动 { t=0; x=x+2; if(x>=h-32)x=0; } } |
|
相关推荐
2个回答
|
|
//SCK上升沿读取数据(由高位送数据),RCK上升沿输出锁存数据 。没有严格的时间要求
***it SI=P3^4;//数据口 ***it SCK=P3^6;//数据输入时钟线 ***it RCK=P3^5;//数据输出时钟线 void Input(unsigned char dat) { char i; for(i=0;i<8;i++) { dat=dat>>1; SCK=1; SI=CY;//取出最高位 SCK=0;//上升沿 } } void Output() { RCK=0; RCK=1; RCK=0;//上升沿输出锁存数据 } |
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
464 浏览 0 评论
478 浏览 1 评论
基于瑞萨FPB-RA4E2智能床头灯项目——1编译环境搭建与点亮驱动ws2812全彩LED
439 浏览 0 评论
嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-LCD显示图片编程示例之介绍mmap
994 浏览 0 评论
《DNESP32S3使用指南-IDF版_V1.6》第二章 常用的C语言知识点
1056 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
11788 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 16:01 , Processed in 0.871143 second(s), Total 73, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号