《LED摇摇棒的详细制作资料_0.docx》由会员分享,可在线阅读,更多相关《LED摇摇棒的详细制作资料_0.docx(12页珍藏版)》请在优知文库上搜索。
1、1.ED摇摇棒的具体制作资料1.ED摇摇棒的具体制作资料1.ED摇摇棒的具体制作资料【图】大家知道,人的眼睛存在视觉暂留现象,正因为眼睛的反应迟钝,才丰富了人的视觉感受。1.ED摇摇棒很好地利用/人眼的视觉衡留特性。下图是基于51单片机限制、16只高亮度1.ED发光二极管构成的摇摇棒,协作手的左右摇摆就可呈现一幅完整的画面,可以显示字符、图片等。演示效果见自制1.ED摇摇棒展示【图】0实物外形图(点击可放大):基本原理与硬件电路设计:16只1.ED发光管作为画面每一列的显示,左右摇摆起到了扫描的作用,人眼的视觉暂留现象使得看到的是一幅完整的画面。与1.ED点阵的显示有几分相仿。硬件电路如下图(
2、点击可放大)。系统电源VCC为5V,下载程序和调试时肯定要保证5V电压,实际运用时用3节干电池串联4.5V即可。AT89S52单片机作为限制器,在它的PO、P2口接有16只以共阳的方式连接的高亮度1.ED,由单片机输出低电平点亮。PO口的上拉电阻RAl不能少。串在1.ED公共端的二极管Dl会产生肯定的压降,用来爱护1.ED,经实测1.ED点亮时两端电压为3V左右,在1.ED的平安承受范围内。Kl是画面切换开关,用于切换显示不同内容:Sl为水银开关。水银开关的作用:棒在摇动时,只能在朝某一方向摇动时显示,否则会出现镜像字或镜像画面,所以通过接一只水银开关来限制,使摇摇棒从左向右摇动时将内容显示出
3、来。硬件制作:运用的是宜径5mm的红色高亮1.ED,感觉太大了些,远看效果很好但近看时字不够连贯。建议运用宜径为3mm的高亮1.ED,颜色可依据个人喜好选择。水银开关里的水银珠很活跃,导致在接通时简单产生抖动,所以将水银开关斜向上放置(尖尖朝斜上方45角),靠水银珠自身重力的作用削减抖动:IC座里面隐藏元件,既美观又能爱护元件:软件设计:/*程序名称:1.ED摇摇棒显示64*16像素简要说明:外部中断方式INTO显示:取模方式:纵向取模、字节倒序编写:JiangX最终更新:08/11/15晚*/#includeT89X52.h#defineucharunsignedchar#defineuin
4、tunsignedint/宏定义#defineKEYP3_0定义画面切换按键ucharKY:KY作用在后面说明uchardisp;显示汉字指针ucharpic=0,num=0;/pic为按键次数;num为中断次数ucharcodelove=0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,OxFE10x3F,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,
5、0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,OxOF,0x04,0x10,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x04,0x10,0xF8,OxOF,0x00,0x00,0x00,0x00,0x00,0x00,OxFE,0x07,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x20,0x00,0x10,0x00,0x08,OxFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,OxFE,0x3F,0x82,0x20,0x82,0x20,
6、0x82,0x20,0x82,0x20,0x82,0x20,0x82,0x20,0x82,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*1.OVE*/;ucharcodeloveyou0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
7、,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,OxOO10x00,0x00,0x78,0x00,OxFC,0x00,OxFE,0x01,OxFE,0x03,OxFE,0x07,OxFE,OxOF,OxFE,OxlF,OxFC,0x3F,0xF8,0x7F,OxFC,0x3F,OxFE,OxlF,OxFE,OxOF,OxFE,0x07,OxFE,0x03,OxFE,0x01,OxFC,0x00,0x78,0x00,0x00
8、,0x00,0x00,0x00,0x00,0x00,0x00,OxOO10x00,OxOO10x00,0x00,0x00,0x00,OxOO10x00,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,/*心形图案*/;ucharcodehehe=0x00,0x00,0x00,0x00,0x00,OxOO10x00,0x00,0x00,0x00,0
9、x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,OxCO,0x01,0x40,0x01,OxCO10x01,0x00,0x00,0x00,0x00,OxFO,OxOF,0x08,0x10,0x04,0x20,0x00,0x00,0x00,0x00,OxFO,0x3F,0x08,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x08,OxOO,OxFO10x3F,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0
10、x00,0x00,0x00,0x00,OxFO,0x3F,0x08,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x08,0x00,OxFO,0x3F,0x00,0x00,0x00,0x00,0x04,0x20,0x08,0x10,OxFO1OxOF,0x00,0x00,0x00,0x00,OxCO,0x01,0x40,0x01,OxCO10x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*呵呵o(_)o图案
11、*/;unsignedcharcodehanzi=/一欢一0x04,0x10,0x34,0x08,0xC4,0x06,0x04,0x01,0xC4,0x82,0x3C,0x8C,0x20,0x40,0x10,0x30,OxOF,OxOC,0xE8,0x03,0x081OxOC,0x08,0x10,0x28,0x60,0x18,OxCO,0x00,0x40,0x00,0x00,/迎0x40,0x00,0x42,0x40,0x44,0x20,0xC8,OxlF,0x00,0x20,OxFC,0x47,0x04,0x42,0x02,0x41,0x82,0x40,OxFC,0x7F,0x04,0x40
12、,0x04,0x42,0x04,0x44,OxFE,0x63,0x04,0x20,0x00,0x00,/-使0x40,0x00,0x20,0x00,0xF8,OxFF,0x07,0x00,0x04,0x80,0xF4,0x43,0x14,0x45,0x14,0x29,0x14,0x19,OxFF10x17,0x14,0x21,0x14,0x21,0x14,0x41,0xF6,0xC3,0x04,0x40,0x00,0x00,/用一0x00,0x80,0x00,0x60,OxFE,OxlF10x22,0x02,0x22,0x02,0x22,0x02,0x22,0x02,OxFE,0x7F,0x2
13、2,0x02,0x22,0x02,0x22,0x42,0x22,0x82,OxFF,0x7F,0x02,0x00,0x00,0x00,0x00,0x00,/一神一0x08,0x01,0x88,0x00,0x49,0x00,OxEE,OxFF,0x58,0x00,0x88,0x00,0x00,0x00,0xF8,OxlF,0x88,0x08,0x88,0x08,OxFF,OxFF10x88,0x08,0x88,0x08,OxFC,OxlF10x08,0x00,0x00,0x00,/一奇一0x40,0x00,0x40,0x00,0x44,0x00,0x44,0x3E,0x64,0x12,0x54,
14、0x12,0xC6,0x7F,0x44,OxOO10x60,OxOO10x40,0x00,0x00,0x00,一魔-0x00,0x40,0x00,0x30,OxFE,0x8F,0x4A,0x80,Ox,0x5F,0x9,0x4,OxFE,0x2A,OxA,Oxl,OxCB,OxOF,OxAA,0x7A,OxFE,0x8A,0x9A,OxAA,OxAA10x8F,0x6B,0x80,0x22,OxEO10x00,0x00,/幻0x80,0x20,OxCO,0x30,OxAO,0x28,0x98,0x24,0x87,0x22,0x80,0x21,0xC4,0x30,0x04,0x60,0x04,0x00,0x04,0x20,0x04,0x40,0x04,0x80,0x04,0x40,OxFE,0x3F,0x04,OxOO10x00,0x00,/-摇一0x10,0x02,0x10,0x42,0x10,0x81,OxFF.0x7F,0x90,0x04,0x54,0x05,OxCC,0xF4,OXB4,0x44,0x84,0x44,OxBC,0x7F,0x82,0x44,0xA2,0x44,0x9B,0xF4,0x82,0x06,0x00,0x04,0x00,0x00,一摇一OxlO10x02,0x10,0x42,0x10,0x81,OxFF,0x