您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > 其它相关文档 > 基于单片机STC89c52的LED旋转屏
本电路包含两部分,分别为LED显示部分,及单片机控制部分,具体成品大家可网上找视频。以下为程序#includereg52.h#includeintrins.h#definequa6320sbitswh=P3^4;unsignedintcount=1,odd=1;unsignedcharpflag=0;unsignedcharcodewenzhi[qua]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,/*,4*/此处添加所需的字,可通过字模转换~~};voidintt()interrupt0{pflag=1;if(count=qua)count=1;elsecount+=2;/*if(odd==0){count-=2;odd=1;}elseodd=0;*/}voiddelay(unsignedinta){for(;a0;a-=1)_no_();}voiddisplay(){unsignedinta,b;if(count445)b=(cont-445);elseb=1;for(a=count;ab;--a){delay(2);P2=wenzhi[a];P1=wenzhi[--a];swh=0;delay(6);sh=1;delay(2);}pflag=0;}voidmain(){swh=1;EA=1;IT0=1;EX0=1;while(1){if(pflag){display();}}}
本文标题:基于单片机STC89c52的LED旋转屏
链接地址:https://www.777doc.com/doc-2573743 .html