Esempio n. 1
0
        elif 'Switch_3_off' in data:
            switch.switch(3, 0)
            tcpCliSock.send(('Switch_3_off').encode())

        else:
            pass


def destory():
    move.clean_all()


if __name__ == '__main__':
    switch.switchSetup()
    switch.set_all_switch_off()
    move.init_all()

    HOST = ''
    PORT = 10223  #Define port serial
    BUFSIZ = 1024  #Define buffer size
    ADDR = (HOST, PORT)

    try:
        led_threading = threading.Thread(
            target=breath_led)  #Define a thread for LED breathing
        led_threading.setDaemon(
            True
        )  #'True' means it is a front thread,it would close when the mainloop() closes
        led_threading.start()  #Thread starts
        LED.breath_color_set('blue')
    except:
Esempio n. 2
0
def closing():
    move.init_all()
    GPIO.output(pinTrigger, False)