Share a control program for a security door

A security door control program that uses a wireless remote control to open the door and the stepper motor performs the action.

Share a control program for a security door


Controlled by AT89C2051 single chip microcomputer, liweiqiang
; P3.3 connected to the peak sounder
; P3.5 door state switch signal input, low potential means the door is closed, high potential means the door is open
; P3.7 remote control open door signal input, low potential means there is a door open signal.
Org 0000h
Ljmp start
Org 000bh
Ljmp int_0

Start:
Mov sp,#60h
Mov tmod,#01h
Mov th0,#0b0h
Mov tl0,#0b8h
Mov r1,#00h
Mov r0,#00h
Setb ea
Setb et0
Setb tr0
;=====================================================
Main:; main loop starts jb p3.5, kss; P35=0, indicating that the door has been closed. Execute jnb 20H.0, kss; 20H.0=0 means locked door. Turn manual unlock signal detection lcall gs ; lock clr 20H.0; set 20H.0 = 0, indicating that the door has been locked.
Kss:;; manual unlock signal detection jnb p3.5, kst; if the door is manually opened from the inside, the lock gate flag is executed downward.
Ajmp ddjm
Kst:; remote control unlock signal detection jb p3.7, kmjs; low level unlock signal? Is to perform lcall delay; delay debounce jnb p3.7, kmjs; confirm whether the unlock button has been released. Is to execute lcall ks; unlock setb tr0; time after unlocking
Kmjs:; open the door timing cjne r0, #30, main; check the state of the door after 15 seconds of opening the door mov r0, #00h
Clr tr0

Ddjm:
Jb p3.5, $; wait for the door to be closed setb 20h.0; clear the locked door mark after the door is closed
Clr tr0; stop counting
Jmp main; back to the main program
;====================================================

Int_0:
Push psw
Push aCC
Inc r1
Cjne r1, #14,ext
Inc r0
Mov r1,#00h
Ext:
Mov th0,#0b0h
Mov tl0,#0b8h
Pop acc
Pop psw
Reti


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Ks:
Mov r0, #3
Loop1:
Mov p1, #10101111b
Acall delay
Mov p1, #11001111b
Acall delay
Mov p1, #11010111b
Acall delay
Mov p1, #10110111b
Acall delay
Djnz r0, loop1
Mov p1,#0ffh
Lcall delay1
Lcall bz
Mov r1,#00h
Setb tr0
Ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gs:
Lcall delay1
Lcall delay1
Lcall delay1
Lcall delay1
Mov r0, #3
Loop2:
Mov p1, #10110111b
Acall delay
Mov p1, #11010111b
Acall delay
Mov p1, #11001111b
Acall delay
Mov p1, #10101111b
Acall delay
Djnz r0, loop2
Mov p1,#0ffh
Lcall delay1
Lcall bz
Lcall delay
Lcall bz

Ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Bz:
Clr p3.3
Lcall delay1
Setb p3.3
Ret
Delay:
Mov r6, #30
D1: mov r7, #0
D2: djnz r7, d2
Djnz r6, d1
Ret


Delay1:
Mov r5, #200
Dd1: mov r4, #100
Dd2: mov r3, #10
Dd3: djnz r3, dd3
Djnz r4, dd2
Djnz r5, dd1
Ret
End

Bluetooth Headphone

Bluetooth Headphone

Bluetooth headpone also call bluetooth earphone or bluetooth earbuds,which is a headset that provides a two-way connection to the user's cellphone via Bluetooth. Fitting in one ear only, the part that is pressed slightly into the ear canal typically comes with removable small, medium and large tips.

Bluetooth headphone1

Bluetooth headphone2

Bluetooth headphone3


Best Wireless Headphones,Bluetooth Head Phones,Noise Ear Buds,Best Earbuds for Running

Pogo Technology International Ltd , https://www.wisesir.net