Exemplo n.º 1
0
def opening(dc4):
    if dc4 == '1':
        opendoor()

    elif dc4 == '2':
        print('warning')
    elif dc4 == '0':
        print('warning: None Human')
Exemplo n.º 2
0
def opening(dc4):
    if dc4 == '1':
        unlocking()
        opendoor()
        f=open("cin.txt", 'w')
        f.write("in")
        f.close
    elif dc4 == '2':
        print('warning')
    elif dc4 == '0':
        print('warning: hacking Error')
Exemplo n.º 3
0
######################################################
try:

    while True:
        if GPIO.input(pir_s) == True:
            print('Sensor On!!')
            k2 = checkin()
            GPIO.output(LED, True)
            if k2 == 'in':
                print('in ---------> off')
                closedoor()
                time.sleep(5)
                checkoff()
            elif k2 == 'off':
                print('off ---------> in')
                opendoor()
                checkon()

        else:
            k2 = checkin()
            if k2 == 'in':
                print('also:in --------> off')
                closedoor()
                time.sleep(5)
                checkoff()

            GPIO.output(LED, False)

except KeyboardInterrupt:
    GPIO.cleanup()
Exemplo n.º 4
0
def opening(dc4):
    if dc4 == '1':
        opendoor()

    elif dc4 == '0':
        print('warning')
Exemplo n.º 5
0
def matchacces():

    matchF = request.args.get('match', '0')
    print(matchF)
    opendoor()
    return matchF