Пример #1
0
ledslaves = [LEDStrip(DriverSlave(len(sarg), pixmap=sarg, pixheights=-1), threadedUpdate=False) \
             for aarg, sarg, fps in wavedatalist]

# Make the animation list
# Wave animations as list pairs (animation instances, fps) added
animationlist = [(WA.Wave(ledslaves[i], *wd[0]), wd[2])
                 for i, wd in enumerate(wavedatalist)]


# needed to run on pixelweb
def genParams():
    return {"start": 0, "end": -1, "animcopies": animationlist}


if __name__ == '__main__':
    masteranimation = MasterAnimation(ledmaster, animationlist, runtime=2)

    # Master launches all in animationlist at preRun
    # Master steps when it gets a go ahdead signal from one of the
    # concurrent annimations
    masteranimation.run(
        fps=None,
        threaded=False)  # if give fps for master will skip faster frames
    masteranimation.stopThread()

    #import threading
    #print threading.enumerate()

    # plot timing data collected from all the animations
    # horizontal axis is time in ms
    # vertical are the various animation and dot is when update sent to leds by master