您的位置 首页 元件

16*16LED点阵显现汉字C51程序

此程序硬件为两片164控制行,两片595控制列***************************作者:UndertakerQQ:1205946980*********************inc

此程序硬件为两片164操控行,两片595操控列.

//***************************作者:Undertaker QQ:1205946980*********************//#include#include#define uchar unsigned char#define uint unsigned intcode uchar TAB[9][32]={{0x00,0x80,0x00,0x80,0xFC,0x80,0x05,0xFE,0x85,0x04,0x4A,0x48,0x28,0x40,0x10,0x40,0x18,0x40,0x18,0x60,0x24,0xA0,0x24,0x90,0x41,0x18,0x86,0x0E,0x38,0x04,0x00,0x00},//欢{0x40,0x00,0x21,0x80,0x36,0x7C,0x24,0x44,0x04,0x44,0x04,0x44,0xE4,0x44,0x24,0x44,0x25,0x44,0x26,0x54,0x24,0x48,0x20,0x40,0x20,0x40,0x50,0x00,0x8F,0xFE,0x00,0x00}, //迎{ 0x01,0x00,0x01,0x00,0x3F,0xFC,0x01,0x00,0x09,0x30,0x05,0x20,0x03,0x40,0x7F,0xFE,0x01,0x80,0x03,0x40,0x05,0x20,0x09,0x18,0x31,0x0E,0xC1,0x04,0x01,0x00,0x01,0x00},  //来{0x00,0x04,0x7F,0x84,0x08,0x04,0x12,0x24,0x21,0x24,0x7F,0xA4,0x25,0x24,0x04,0x24,0x04,0x24,0x7F,0xA4,0x04,0x24,0x04,0x24,0x05,0x84,0x0E,0x04,0x70,0x14,0x20,0x08,}, //到{0x08,0x20,0x06,0x30,0x04,0x40,0x3F,0xF8,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x01,0x00,0xFF,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00}, // 单{0x00,0x40,0x10,0x40,0x10,0x40,0x10,0x44,0x1F,0xFE,0x10,0x00,0x10,0x00,0x10,0x00,0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x20,0x10,0x40,0x10,0x80,0x10}, //片{0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x88,0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x00},//机{0x00,0x00,0x12,0x10,0x12,0x10,0x12,0x10,0x12,0x10,0xFF,0xFE,0x12,0x10,0x12,0x10,0x12,0x10,0x13,0xF0,0x12,0x10,0x10,0x00,0x10,0x08,0x1F,0xFC,0x00,0x00,0x00,0x00},//世{0x1F,0xF8,0x11,0x08,0x11,0x08,0x1F,0xF8,0x11,0x08,0x11,0x08,0x1F,0xF8,0x11,0x88,0x02,0x40,0x04,0x30,0x1A,0x4E,0x62,0x44,0x02,0x40,0x04,0x40,0x08,0x40,0x10,0x40,} //界};void delay(uint z){uint x,y;for(x=z;x>0;x--)for(y=125;y>0;y--);}//************************显现程序**************************************************//sbit SCK=P3^2;sbit AB =P3^3;sbit ST =P3^5;sbit SH=P3^6;sbit DS=P3^7;uchar m=0,n;void xianshi(){uchar i;uchar j;uchar a;uchar dat;AB=0;for(j=0;j<16;j++){SCK=0;ST=0;for(a=2;a>0;){a--;dat=TAB[m][2*j+a];for(i=0;i<8;i++){SH=0;if(dat&0x01==0x01){DS=0;}else{DS=1;}SH=1;dat>>=1;}}P3|=0x24;delay(1);AB=1;}AB=1;SCK=0;SCK=1;SCK=0;}interrupt_hs() interrupt 1{TL0=(65536-50000)%256;TH0=(65536-50000)/256;n++;if(n==30){n=0;m++;if(m==9){m=0;}}}void main(){TMOD=0x01;TL0=(65536-50000)%256;TH0=(65536-50000)/256;ET0=1;EA=1;TR0=1;while(1){xianshi();}}//*此程序为16*16LED点阵替换显现以上汉字!重视了解595 164芯片的功能及使用及LED点阵的作业原理!此程序由Undertaker独立编写完结!*//

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/xinpin/yuanjian/255322.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部