Exemplo n.º 1
0
                print("reeds uitgeschakeld")
        #telkens nieuwste in en uitschakel json ophalen
        indata = DataRepository.read_gepland(1)
        uitdata = DataRepository.read_gepland(0)
        socketio.emit("B2F_gepland")
        #inschakeltijd en uitschakeltijd uit json halen
        for data in indata:
            inschtijd = data["tijdstip"]
            inschtijd = str(inschtijd)[:-3]
        for data in uitdata:
            uitschtijd = data["tijdstip"]
            uitschtijd = str(uitschtijd)[:-3]
        time.sleep(59)


knop1.on_press(lees_knop)

ir.on_ir_receive()

lcd_init()

proces = threading.Thread(target=printIP)
proces2 = threading.Thread(target=socket)
proces3 = threading.Thread(target=arduinocom)
proces4 = threading.Thread(target=plannen)

if __name__ == '__main__':
    try:
        proces4.start()
        proces3.start()
        proces2.start()
Exemplo n.º 2
0
    choice = song_list[pick]
    play_song(choice)


def knop_pressed(pin):

    print("Knop is ingedrukt")
    pick_song()
    time.sleep(1)


threading.Timer(1, lees_potentio).start()
threading.Timer(2, lees_thermistor).start()
threading.Timer(1, lees_pulse).start()

knop1.on_press(knop_pressed)

try:
    display.setup()
    print("Display setup complete")
    #write_message("")
    display.send_instruction(0b11000000)
    display.write_message("169.254.10.1")
    print("Display message completed")

except KeyboardInterrupt as e:
    print("quitting...")

if __name__ == '__main__':
    socketio.run(app, debug=False, host='0.0.0.0')