Beispiel #1
0
        # Start Ev3 screen
        display = RobotDisplay('maker')
        display.startScreen()

        # Starting battery thread
        battery = Battery(client, display)

        # Starting button thread
        button = Button(client, display)

        # Declare movement
        action = Actions()

        print("Start main thread\n")

        while True:
            action.movement(client, display)

    # Server is not connected
    except ConnectionRefusedError:
        # Declare movement
        action = Actions()

        # Play error sound
        action.playFile("Sounds/4.wav")

        # Get current time HH:MM:SS
        now = datetime.now()
        time = now.strftime("%H:%M:%S")
        print(str(time) + ": Server is not connected")