Beispiel #1
0
def main():
    global matrix

    sys.excepthook = exceptionHandler

    matrix = OPCMatrix(dpyinfo.WIDTH, dpyinfo.HEIGHT,
                        dpyinfo.ADDRESS, dpyinfo.ZIGZAG)
    arts = ImportPlugins("art", ["template.py"], sys.argv[1:], matrix)

    if len(arts) == 0:
        logging.error("Couldn't find any art to execute")
        exit(1)

    sleep(3)

    while True:
        seed(time())

        for art in arts:
            matrix.setFirmwareConfig()
            art.start(matrix)
            t = time()
            while time()-t < FLIPTIME:
                art.refresh(matrix)
                matrix.show()
                sleep(art.interval()/1000.0)