;This program will show you cycle glitter between 8 led lamps; maker:Chen Weiwu; date:2012-11-08; version:1.0.0;-------------------------------------------------------------;DefineLedprt equ p0SegDisPlay equ p2L1 equ 30hl3 equ 32hbutton1 equ p1.0button2 equ p1.2button3 equ p1.4button4 equ p1.6 ;----------------------;Set the initiation address which the program runing;---------------------- org 0 ajmp main;----------------------Pattern1: mov a,#11111110BCycle1: mov Ledprt,a rl a acall delay jnb button1,cycle1 mov Ledprt,#11111111B ret ;----------------------- Pattern2: mov a,#01111111B mov l1,#00000001B Cycle2: mov l3,a xrl a,l1 mov Ledprt,a mov a,l3 rl a mov l3,a mov a,l1 rr a mov l1,a mov a,l3 acall delay jnb button2,cycle2 mov Ledprt,#11111111B ret;-----------------------Pattern3: mov a,#10101010B Cycle3: mov l1,a mov Ledprt,a acall delay mov a,#11111111B mov Ledprt,a acall delay mov a,l1 rl a jnb button3,cycle3 mov Ledprt,#11111111B ret;-----------------------Pattern4: mov a,#11111110B mov l1,#00000001BCycle4: mov Ledprt,a acall delay rl a xrl a,l1 jnb button4,cycle4 mov Ledprt,#11111111B ret ;-----------------------;-----------------------;delay sectiondelay: mov r5,#50delay1: mov r6,#100DELAY2: mov r7,#10 djnz r7,$ djnz r6,delay2 djnz r5,delay1 ret;-----------------------main: mov SegDisPlay,#00H jb button1,To2 mov SegDisPlay,#01H Acall Pattern1To2: jb button2,To3 mov SegDisPlay,#02H Acall Pattern2To3: jb button3,To4 mov SegDisPlay,#03H Acall Pattern3To4: jb button4,main mov SegDisPlay,#04H Acall Pattern4 ajmp Main;----------------------- end;-------------------------------------------------------------
-电子元器件采购网(www.ruidan.com)是本土元器件目录分销商,采用“小批量、现货、样品”销售模式,致力于满足客户多型号、高质量、快速交付的采购需求。 自建高效智能仓储,拥有自营库存超过50,000种,提供一站式正品现货采购、个性化解决方案、选型替代等多元化服务。