Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/16/13 16:13
Read: times


 
#189193 - led chaser_comment
Responding to: ???'s previous message
dear sir thank you very much to all for their suggestions..

sir commented codes are here, there is two codes, can it be helpful for me?
it is my humble request please try to modify these code for variable speed by variable preset resistor and second one locking current pattern which is running...

code 1 is:-


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;PROGRAM FOR DANCING LED;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



ORG 0000H



L1 EQU P3.4 ;L1 to L11 are LEDs for dancing effect of light
L2 EQU P3.1
L3 EQU P3.0
L4 EQU P1.7
L5 EQU P1.6
L6 EQU P1.5
L7 EQU P1.4
L8 EQU P1.3
L9 EQU P1.2
L10 EQU P1.1
L11 EQU P1.0



FNAUTO: MOV R3,#05 ;Selected count for five times play of same light effect

D1: CALL DESGN1 ;nine different dancing patterns/ effect, called one by one
DJNZ R3,D1
MOV R3,#05
D2: CALL DESGN2
DJNZ R3,D2
MOV R3,#05
D3: CALL DESGN3
DJNZ R3,D3
MOV R3,#05
D4: CALL DESGN4
DJNZ R3,D4
MOV R3,#05
D5: CALL DESGN5
DJNZ R3,D5
MOV R3,#05
D6: CALL DESGN6
DJNZ R3,D6
MOV R3,#05
D7: CALL DESGN7
DJNZ R3,D7
MOV R3,#05
D8: CALL DESGN8
DJNZ R3,D8
MOV R3,#05
D9: CALL DESGN9
DJNZ R3,D9
MOV R3,#05
JMP FNAUTO



DESGN1: CLR L1 ;sub Routine for pattern1
SETB L2
CLR L3
SETB L4
CLR L5
SETB L6
CLR L7
SETB L8
CLR L9
SETB L10
CLR L11
CALL DELAY
CLR L2
SETB L1
CLR L4
SETB L3
CLR L6
SETB L5
CLR L8
SETB L7
CLR L10
SETB L9
SETB L11
CALL DELAY
RET

DESGN2: CALL CLEAR ;Sub Routine for pattern2
CLR L1
CALL DELAY
CALL CLEAR
CLR L2
CALL DELAY
CALL CLEAR
CLR L3
CALL DELAY
CALL CLEAR
CLR L4
CALL DELAY
CALL CLEAR
CLR L5
CALL DELAY
CALL CLEAR
CLR L6
CALL DELAY
CALL CLEAR
CLR L7
CALL DELAY
CALL CLEAR
CLR L8
CALL DELAY
CALL CLEAR
CLR L9
CALL DELAY
CALL CLEAR
CLR L10
CALL DELAY
CALL CLEAR
CLR L11
CALL DELAY
RET

DESGN3: CALL CLEAR ;Sub Routine for pattern3
CLR L11
CALL DELAY
CALL CLEAR
CLR L10
CALL DELAY
CALL CLEAR
CLR L9
CALL DELAY
CALL CLEAR
CLR L8
CALL DELAY
CALL CLEAR
CLR L7
CALL DELAY
CALL CLEAR
CLR L6
CALL DELAY
CALL CLEAR
CLR L5
CALL DELAY
CALL CLEAR
CLR L4
CALL DELAY
CALL CLEAR
CLR L3
CALL DELAY
CALL CLEAR
CLR L2
CALL DELAY
CALL CLEAR
CLR L1
CALL DELAY
RET

DESGN4: CALL CLEAR ;Sub Routine for pattern4
CLR L1
CALL DELAY
CALL CLEAR
CLR L2
CALL DELAY
CALL CLEAR
CLR L3
CALL DELAY
CALL CLEAR
CLR L4
CALL DELAY
CALL CLEAR
CLR L5
CALL DELAY
CALL CLEAR
CLR L6
CALL DELAY
CALL CLEAR
CLR L7
CALL DELAY
CALL CLEAR
CLR L8
CALL DELAY
CALL CLEAR
CLR L9
CALL DELAY
CALL CLEAR
CLR L10
CALL DELAY
CALL CLEAR
CLR L11
CALL DELAY
CALL CLEAR
CLR L11
CALL DELAY
CALL CLEAR
CLR L10
CALL DELAY
CALL CLEAR
CLR L9
CALL DELAY
CALL CLEAR
CLR L8
CALL DELAY
CALL CLEAR
CLR L7
CALL DELAY
CALL CLEAR
CLR L6
CALL DELAY
CALL CLEAR
CLR L5
CALL DELAY
CALL CLEAR
CLR L4
CALL DELAY
CALL CLEAR
CLR L3
CALL DELAY
CALL CLEAR
CLR L2
CALL DELAY
CALL CLEAR
CLR L1
CALL DELAY
RET

DESGN5: CALL CLEAR ;Sub Routine for pattern5
CLR L1
CLR L11
CALL DELAY
CALL CLEAR
CLR L2
CLR L10
CALL DELAY
CALL CLEAR
CLR L3
CLR L9
CALL DELAY
CALL CLEAR
CLR L4
CLR L8
CALL DELAY
CALL CLEAR
CLR L5
CLR L7
CALL DELAY
CALL CLEAR
CLR L6
CALL DELAY
CALL CLEAR
CLR L7
CLR L5
CALL DELAY
CALL CLEAR
CLR L8
CLR L4
CALL DELAY
CALL CLEAR
CLR L9
CLR L3
CALL DELAY
CALL CLEAR
CLR L10
CLR L2
CALL DELAY
CALL CLEAR
CLR L11
CLR L1
CALL DELAY
CALL CLEAR
RET

DESGN6: CALL ALLON ;Sub Routine for pattern6
CALL DELAY
CALL CLEAR
CALL DELAY
RET

DESGN7: CALL ALLON ;Sub Routine for pattern7
SETB L1
CALL DELAY
CALL ALLON
SETB L2
CALL DELAY
CALL ALLON
SETB L3
CALL DELAY
CALL ALLON
SETB L4
CALL DELAY
CALL ALLON
SETB L5
CALL DELAY
CALL ALLON
SETB L6
CALL DELAY
CALL ALLON
SETB L7
CALL DELAY
CALL ALLON
SETB L8
CALL DELAY
CALL ALLON
SETB L9
CALL DELAY
CALL ALLON
SETB L10
CALL DELAY
CALL ALLON
SETB L11
CALL DELAY
RET

DESGN8: CALL ALLON ;Sub Routine for pattern8
SETB L11
CALL DELAY
CALL ALLON
SETB L10
CALL DELAY
CALL ALLON
SETB L9
CALL DELAY
CALL ALLON
SETB L8
CALL DELAY
CALL ALLON
SETB L7
CALL DELAY
CALL ALLON
SETB L6
CALL DELAY
CALL ALLON
SETB L5
CALL DELAY
CALL ALLON
SETB L4
CALL DELAY
CALL ALLON
SETB L3
CALL DELAY
CALL ALLON
SETB L2
CALL DELAY
CALL ALLON
SETB L1
CALL DELAY
RET

DESGN9: CALL ALLON ;Sub Routine for pattern9
SETB L11
SETB L1
CALL DELAY
CALL ALLON
SETB L10
SETB L2
CALL DELAY
CALL ALLON
SETB L9
SETB L3
CALL DELAY
CALL ALLON
SETB L8
SETB L4
CALL DELAY
CALL ALLON
SETB L7
SETB L5
CALL DELAY
CALL ALLON
SETB L6
CALL DELAY
CALL ALLON
SETB L5
SETB L7
CALL DELAY
CALL ALLON
SETB L4
SETB L8
CALL DELAY
CALL ALLON
SETB L3
SETB L9
CALL DELAY
CALL ALLON
SETB L2
SETB L10
CALL DELAY
CALL ALLON
SETB L1
SETB L11
CALL DELAY
RET
;********************************************************
;Sub routine for OFF all the LEDs
;********************************************************

CLEAR: SETB L1 ;Sub routine for OFF all the LEDs
SETB L2
SETB L3
SETB L4
SETB L5
SETB L6
SETB L7
SETB L8
SETB L9
SETB L10
SETB L11
RET
;*******************************************************
;Sub routine for ON all the LEDs
;********************************************************
ALLON: CLR L1 ;Sub routine for ON all the LEDs
CLR L2
CLR L3
CLR L4
CLR L5
CLR L6
CLR L7
CLR L8
CLR L9
CLR L10
CLR L11
RET

DELAY: MOV R0,#0FFH
INLOP: MOV R1,#0FFH
DJNZ R1,$
DJNZ R0,INLOP
RET

END

------------------------------------------------------------------------------------------------------------------
second code is:-

ORG 0000H
LJMP MAIN

;Delay function.Put 16-bit delay in milli seconds.R1-higher byte and R0-lower byte.
DELAY:
MOV TL0,#0FFH
MOV TH0,#0E0H
SETB TR0
CONTINUE:JNB TF0,CONTINUE ;Delay for 1ms
CLR TF0
CLR TR0
DJNZ R0,DELAY ;Lower
CJNE R1,#00H,LABEL ;Higher
RET
LABEL:
DEC R1
SJMP DELAY

;**************Main***************
MAIN:

;call subroutine FORWARD for 10 times
MOV R2,#0aH
LABEL_0:
LCALL FORWARD
DJNZ R2,LABEL_0

;call subroutine REVERSE for 10 times
MOV R2,#0aH
LABEL_1:
LCALL REVERSE
DJNZ R2,LABEL_1

;call subroutine DESIGN1 for 10 times
MOV R2,#0aH
LABEL_2:
LCALL DESIGN1
DJNZ R2,LABEL_2

LJMP MAIN

;DESIGN1 subroutine
DESIGN1:
MOV P1,#0ffH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0bfH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0dfH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0efH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0f7H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0fbH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0fdH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0feH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#0ffH
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
RET

;FORWARD subroutine
FORWARD:
MOV P1,#080H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#040H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#020H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#010H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#08H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#04H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#02H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#01H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
RET

;REVERSE subroutine
REVERSE:
MOV P1,#01H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#02H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#04H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#08H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#010H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#020H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#040H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
MOV P1,#080H
MOV R1,#00H
MOV R0,#032H
LCALL DELAY
RET

END


List of 36 messages in thread
TopicAuthorDate
LED CHASER            01/01/70 00:00      
   To avoid problems            01/01/70 00:00      
      RMW uses latch            01/01/70 00:00      
      LED CHASER            01/01/70 00:00      
         very possible            01/01/70 00:00      
            LED CHASER            01/01/70 00:00      
               Do you know what comments are?            01/01/70 00:00      
                  oddly enough            01/01/70 00:00      
                     Very true            01/01/70 00:00      
                     Design your project in the first place            01/01/70 00:00      
               yes, when            01/01/70 00:00      
                  led chaser_comment            01/01/70 00:00      
                     it would be helpful            01/01/70 00:00      
                        chip             01/01/70 00:00      
                           read the datasheet            01/01/70 00:00      
                              potentiometer            01/01/70 00:00      
                                 Erik's typing            01/01/70 00:00      
                                 RE: potentiometer            01/01/70 00:00      
                              Not entirely true            01/01/70 00:00      
                                 The AT89C2051 has analog comparator            01/01/70 00:00      
                                    LED currents            01/01/70 00:00      
                                       no, you have not            01/01/70 00:00      
                                          comment            01/01/70 00:00      
                                             which is also uncommented scribbles            01/01/70 00:00      
                                                comment            01/01/70 00:00      
                                                   He wants you to put descriptive, detailed comments            01/01/70 00:00      
                                                      thanks             01/01/70 00:00      
                                                         Will you do it?            01/01/70 00:00      
                                                            comment            01/01/70 00:00      
                                                               A method I have used for LED signs            01/01/70 00:00      
                                                                  OMG            01/01/70 00:00      
                                                                     one example, please            01/01/70 00:00      
                                                               bear in mind that not everyone will recognize "LED Chaser"            01/01/70 00:00      
                                                   apparently you still don't know what comments are            01/01/70 00:00      
   no, you don't            01/01/70 00:00      
   ADC with 89C2051 comparator            01/01/70 00:00      

Back to Subject List