- UID
- 111482
- 帖子
- 5976
- 积分
- 19792
- 威望
- 13159
- 金币
- 4654721
- 贡献
- 6623
- 职业
- 单片机编程家电维修
- 注册时间
- 2007-9-21
- 最后登录
- 2012-1-7
|
5#
发表于 2009-11-6 15:39
| 只看该作者
摇摇棒很简单啊。给你详细资料自己做吧。
注意:水银开关要呈45斜度摇起来效果最好!
ORG 0000H
AJMP WGQWXD
ORG 0003H
AJMP INT
ORG 0030H
WGQWXD:SETB EA
SETB IT0
SETB EX0
AJMP $
;==============================================================================
INT: JNB P3.5,WGQ_B
RETI
;==============================================================================
WGQ_B: MOV R2,#00H
WGQ_A: MOV A,R2
MOV DPTR,#TAB
MOVC A,@A+DPTR
CPL A
MOV 54H,A
INC R2
MOV A,R2
MOV DPTR,#TAB
MOVC A,@A+DPTR
CPL A
MOV 55H,A
ACALL DL
MOV P0,55H
MOV P2,54H
INC R2
CJNE R2,#254,WGQ_A;#32为1个字,#64为2个字,以此类推.
RETI
;==============================================================================
DL: MOV R3,#030H
L1: MOV R4,#010H
L2: DJNZ R4,L2
DJNZ R3,L1
RET
;===这个字型码你根据需要的字符修改========================================================
TAB: DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H;空字符
DB 04H,00H,24H,10H,24H,12H,24H,21H
DB 7FH,0FEH,0C4H,40H,44H,84H,04H,08H
DB 0FFH,90H,04H,60H,44H,58H,35H,86H
DB 04H,01H,0CH,07H,04H,00H,00H,00H;我
DB 00H,40H,40H,40H,50H,40H,57H,5FH
DB 55H,52H,55H,0D2H,55H,52H,0F5H,52H
DB 55H,52H,55H,0D2H,55H,52H,57H,7FH
DB 0D0H,50H,40H,0C0H,00H,40H,00H,00H;喜
DB 20H,08H,2CH,10H,23H,60H,20H,80H
DB 23H,41H,3CH,31H,04H,02H,08H,0CH
DB 0F0H,30H,17H,0C0H,10H,30H,10H,08H
DB 14H,06H,18H,03H,00H,02H,00H,00H;欢
DB 00H,08H,00H,08H,1FH,0E8H,92H,48H
DB 52H,48H,32H,48H,12H,48H,1FH,0FFH
DB 12H,48H,32H,48H,52H,48H,92H,48H
DB 3FH,0C8H,10H,18H,00H,08H,00H,00H;单
DB 00H,01H,00H,02H,7FH,0FCH,04H,80H
DB 04H,80H,04H,80H,04H,80H,04H,80H
DB 0FCH,80H,04H,0FFH,04H,00H,04H,00H
DB 04H,00H,0CH,00H,04H,00H,00H,00H;片
DB 08H,20H,08H,0C0H,0BH,00H,0FFH,0FFH
DB 09H,01H,08H,82H,00H,04H,3FH,0F8H
DB 20H,00H,20H,00H,20H,00H,7FH,0FCH
DB 20H,02H,00H,02H,00H,0EH,00H,00H;机
DB 00H,00H,00H,00H,00H,00H,00H,00H;空字符
;==============================================================================
END |
附件: 您所在的用户组无法下载或查看附件
|