示例#1
0
文件: CAM2.py 项目: bbkiwi/SpyderWork
             for aarg, sarg, fps in wormdatalist]

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

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()
示例#2
0
文件: CAM0.py 项目: bbkiwi/SpyderWork
# dummy  LED strips must each have their own slavedrivers
ledslaves = [LEDStrip(DriverSlave(len(sarg), pixmap=sarg, pixheights=-1), 
                      threadedUpdate=False, masterBrightness=255) 
                      for aarg, sarg, fps in wormdatalist]

# Make the animation list
# Worm animations as list pairs (animation instances, fps) added
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
示例#3
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
示例#4
0
             masterBrightness=255) for aarg, sarg, fps in wormdatalist
]

# Make the animation list
# Worm animations as list pairs (animation instances, fps) added
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():