示例#1
0
def opening(dc4):
    if dc4 == '1':
        opendoor()

    elif dc4 == '2':
        print('warning')
    elif dc4 == '0':
        print('warning: None Human')
示例#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')
示例#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()
示例#4
0
def opening(dc4):
    if dc4 == '1':
        opendoor()

    elif dc4 == '0':
        print('warning')
示例#5
0
def matchacces():

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