Пример #1
0
ledslaveb = LEDMatrix(DriverSlave(160, None, 0), width=16, height=10,  threadedUpdate=False, masterBrightness=80)
bloom = BA.Bloom(ledslaveb)
animationlist.append((bloom, 10))

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

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

    # 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
    import matplotlib.pyplot as plt
    plt.clf()
    col = 'brgcwk'
    [plt.plot(masteranimation.timedata[i], [i] * len(masteranimation.timedata[i]), col[i%6]+'o') for i in range(len(animationlist))]
    ax = plt.axis()
    delx = .01 * (ax[1] - ax[0])
    plt.axis([ax[0]-delx, ax[1]+delx, ax[2]-1, ax[3]+1]) 
Пример #2
0
animationlist = [(Worm(ledslaves[i], *wd[0]), wd[2]) for i, wd in enumerate(wormdatalist)]

# 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


    # if give fps for master will skip faster frame
    masteranimation.run(fps=None, threaded=True)
    # if threaded is False will wait otherwise not
    
    # this will stop as soon as executed, so if threded=True above will
    #   be immediated stopped!
    # masteranimation.stopThread() 

    # wait here before plotting otherwise data wont be ready
    while not masteranimation.stopped():
        pass
    
    # 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
    import matplotlib.pyplot as plt
    plt.clf()
Пример #3
0
                 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
    try:
        import matplotlib.pyplot as plt
        plt.clf()
        col = 'brgcwk'
        [
            plt.plot(masteranimation.timedata[i],
Пример #4
0

# 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

    # if give fps for master will skip faster frame
    masteranimation.run(fps=None, threaded=True)
    # if threaded is False will wait otherwise not

    # this will stop as soon as executed, so if threded=True above will
    #   be immediated stopped!
    # masteranimation.stopThread()

    # wait here before plotting otherwise data wont be ready
    while not masteranimation.stopped():
        pass

    # 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
    import matplotlib.pyplot as plt
    plt.clf()