公告:新满多没有杂乱广告的网站, 请大家收藏!很好记,域名是 新满多 拼音!xinmanduo.com ! 更简洁好记的 ykyh.net

您的当前位置:首页 > 科技小制作 > 正文 -- 手机或者平板访问

简单实用的十字旋转LED点阵

来源:未知 编辑:晚一步 时间:2017-03-19
电路原理图,原理图非常简单,单片机32个IO口分别控制16个红LED和16个绿LED;一个红外发射管,一个红外接收管,板上的红外接收管每转动一圈就会导通一次,让单片机知道从哪一点开始播放字符或者图象;无线供电部分通过线圈向主板供电,相当于变压器的工作原理:
 
源程序:
 org 00h
  jmp cfg
  org 03h
  clr 00h
  reti
cfg: ;setb ea
;  setb ex0
;  setb it0 
  mov dptr,#tab
MM00: CLR 00H
mm: mov a,r2
  movc a,@a+dptr
cpl a
call hbit
  mov r4,a
  deC r2
  mov a,r2
  movc a,@a+dptr
dec r2
  
  cpl a
call hbit
jb 01h,gr0
mov p1,a
mov p3,r4
jmp gr00
gr0:mov p2,a
mov p0,r4
gr00:
djnz r6,$
djnz r6,$
;djnz r6,$
cjne r2,#0ffh,mmm
mov p0,#0ffh
mov p1,#0ffh
mov p2,#0ffh
mov p3,#0ffh
jb 0e8h.3,$   ;检测是否低电平
mmm:  jb 0e8h.3,MM00   ;检测是否低电平
  jb 00h,mm
  setb 00h
mov r2,#0ffh
  inc dptr
  inc dptr
  inc dptr
  inc dptr
mov a,dph
cjne a,#tab2/256,e0d
  mov dptr,#tab
cpl 01h
e0d: jmp mm
hbit:  ;这是一个位交换子程序,用来实现字倒着显示或者正着显示,倒着显示时适合电动机在上面挂起来安装的情况。
mov c,acc.0
mov b.7,c
mov c,acc.1
mov b.6,c
mov c,acc.2
mov b.5,c
mov c,acc.3
mov b.4,c
mov c,acc.4
mov b.3,c
mov c,acc.5
mov b.2,c
mov c,acc.6
mov b.1,c
mov c,acc.7
mov b.0,c
mov a,b
ret
 
org 200h
con:db 4,1000000b,2,108;字的紧密,亮度,转的速度,内容长度
;org 300h,下面是显示的数据内容,是用本站软件自动生成的供码,请自行修改,其中的0000000000数据是加进去的空白代码,用来显示开头和结尾的空白;;………………数据内容省略
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
tab:
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 00h,04h,40h,04h,41h,04h,41h,04h
db 41h,04h,41h,0fch,7fh,04h,41h,04h
db 41h,04h,41h,04h,43h,0fch,41h,04h
db 40h,04h,00h,0ch,00h,04h,00h,00h
db 00h,00h,01h,00h,01h,00h,01h,00h
db 01h,00h,01h,00h,01h,00h,01h,00h
db 01h,00h,01h,00h,01h,00h,01h,00h
db 01h,00h,03h,00h,01h,00h,00h,00h
db 00h,00h,00h,00h,1fh,0f0h,12h,20h
db 12h,20h,12h,20h,12h,20h,0ffh,0fch
db 12h,22h,12h,22h,12h,22h,12h,22h
db 1fh,0f2h,00h,02h,00h,0eh,00h,00h
db 00h,80h,00h,80h,40h,80h,40h,80h
db 40h,80h,40h,82h,40h,81h,47h,0feh
db 48h,80h,50h,80h,60h,80h,40h,80h
db 00h,80h,01h,80h,00h,80h,00h,00h
db 10h,04h,1fh,0fch,00h,84h,01h,00h
db 01h,00h,01h,04h,00h,0fch,00h,04h
db 00h,00h,01h,00h,01h,00h,07h,0f8h
db 01h,04h,01h,04h,00h,00h,00h,00h
db 00h,00h,01h,00h,01h,00h,07h,0f8h
db 01h,04h,01h,04h,00h,00h,00h,00h
db 01h,01h,01h,0ffh,00h,85h,01h,04h
db 01h,04h,00h,88h,00h,70h,00h,00h
db 00h,00h,00h,00h,00h,00h,03h,0ch
db 03h,0ch,00h,00h,00h,00h,00h,00h
db 00h,00h,00h,06h,00h,18h,00h,60h
db 01h,80h,06h,00h,18h,00h,20h,00h
db 00h,00h,00h,06h,00h,18h,00h,60h
db 01h,80h,06h,00h,18h,00h,20h,00h
tab1:db 01h,0f0h,01h,0ch,00h,30h,01h,0c0h
db 00h,30h,01h,0ch,01h,0f0h,01h,00h
db 01h,0f0h,01h,0ch,00h,30h,01h,0c0h
db 00h,30h,01h,0ch,01h,0f0h,01h,00h
db 01h,0f0h,01h,0ch,00h,30h,01h,0c0h
db 00h,30h,01h,0ch,01h,0f0h,01h,00h
db 00h,00h,00h,0ch,00h,0ch,00h,00h
db 00h,00h,00h,00h,00h,00h,00h,00h
db 00h,00h,1fh,98h,10h,84h,11h,04h
db 11h,04h,10h,88h,10h,70h,00h,00h
;………………数据内容省略,
tab2:end
 
手机扫描本二维码

分享创意到朋友圈

网友评论:



Copyright © 2006-2017 新满多 渝ICP备11004546号-1

如有侵犯,请联系我们:Gaocheng365@live.com

Top