コード例 #1
0
def extra_demo():
    # One cycle of red, green and blue each
    print('One strandtest of red, green and blue each')
    MY_CYCLE = colorschemes.StrandTest(num_leds=NUM_LEDS, pause_value=0,
                                       num_steps_per_cycle=NUM_LEDS, num_cycles=3, order="rbg",
                                       global_brightness=10)
    MY_CYCLE.start()

    # Two slow trips through the rainbow
    print('Two slow trips through the rainbow')
    MY_CYCLE = colorschemes.Rainbow(num_leds=NUM_LEDS, pause_value=0,
                                    num_steps_per_cycle=255, num_cycles=2, order="rbg",
                                    global_brightness=10)
    MY_CYCLE.start()

    # Five quick trips through the rainbow
    print('Five quick trips through the rainbow')
    MY_CYCLE = colorschemes.TheaterChase(num_leds=NUM_LEDS, pause_value=0.04,
                                         num_steps_per_cycle=35, num_cycles=4, order="rbg",
                                         global_brightness=5)
    MY_CYCLE = colorschemes.TheaterChase(num_leds=NUM_LEDS, pause_value=0.04,
                                         num_steps_per_cycle=35, num_cycles=4, order="rbg",
                                         global_brightness=100)
    MY_CYCLE.start()

    print('Finished the test')
コード例 #2
0
ファイル: runcolorcycle.py プロジェクト: krux702/APA102_Pi
    if 3 in args.patterns:
        # One slow trip through the rainbow
        print('One slow trip through the rainbow')
        MY_CYCLE = ColorCycleTemplate(num_steps_per_cycle=255,
                                      num_cycles=1,
                                      **options)
        rainbow = colorschemes.Rainbow(**options)
        MY_CYCLE.append_updater(rainbow.update)
        MY_CYCLE.append_updater(colorschemes.create_swipe(args.num_led - 1, 0))
        MY_CYCLE.start()

    if 4 in args.patterns:
        # Five quick trips through the rainbow
        print('Five quick trips through the rainbow')
        MY_CYCLE = colorschemes.TheaterChase(pause_value=0.04,
                                             num_steps_per_cycle=35,
                                             num_cycles=5,
                                             **options)
        MY_CYCLE.start()

    if 5 in args.patterns:
        print('A Larson Scanner, a fire, and red alert')
        MY_CYCLE = ColorCycleTemplate(pause_value=0.02,
                                      num_steps_per_cycle=60,
                                      num_cycles=5,
                                      **options)
        num_updaters = 5
        sec_width = args.num_led // num_updaters
        sec_ranges = list(
            zip(range(0, args.num_led, sec_width),
                range(sec_width - 1, args.num_led, sec_width)))
        sec_ranges[-1] = (sec_ranges[-1][0], args.num_led - 1
コード例 #3
0
ファイル: runcolorcycle.py プロジェクト: AKbiology/APA102_Pi
import datetime

NUM_LED = 200
today = datetime.datetime.now()

# One Cycle with one step and a pause of three seconds. Hence three seconds of white light
print('Three Seconds of white light')
MY_CYCLE = colorschemes.Solid(num_led=NUM_LED,
                              pause_value=3,
                              num_steps_per_cycle=1,
                              num_cycles=1)
MY_CYCLE.start()

# One slow trip through the rainbow
print('One slow trip through the rainbow')
MY_CYCLE = colorschemes.Rainbow(num_led=NUM_LED,
                                pause_value=0,
                                num_steps_per_cycle=255,
                                num_cycles=1)
MY_CYCLE.start()

# Five quick trips through the rainbow
print('Five quick trips through the rainbow')
MY_CYCLE = colorschemes.TheaterChase(num_led=NUM_LED,
                                     pause_value=0.04,
                                     num_steps_per_cycle=35,
                                     num_cycles=5)
MY_CYCLE.start()

print('Finished the test')
print('current time:', today.ctime())
コード例 #4
0
import colorschemes

numLEDs = 144
# One Cycle with one step and a pause of one second. Hence one second of white light
#myCycle = colorschemes.Solid(numLEDs=numLEDs, pauseValue=1, numStepsPerCycle = 1, numCycles = 1)
#myCycle.start()
# Go twice around the clock
#myCycle = colorschemes.RoundAndRound(numLEDs=numLEDs, pauseValue=0, numStepsPerCycle = numLEDs, numCycles = 2)
#myCycle.start()
# One cycle of red, green and blue each
#myCycle = colorschemes.StrandTest(numLEDs=numLEDs, pauseValue=0, numStepsPerCycle = numLEDs, numCycles = 3, globalBrightness=10)
#myCycle.start()
# Two slow trips through the rainbow
myCycle = colorschemes.Rainbow(numLEDs=numLEDs,
                               pauseValue=0,
                               numStepsPerCycle=255,
                               numCycles=20,
                               globalBrightness=10)
myCycle.start()
# Five quick trips through the rainbow
myCycle = colorschemes.TheaterChase(numLEDs=numLEDs,
                                    pauseValue=0.04,
                                    numStepsPerCycle=35,
                                    numCycles=5,
                                    globalBrightness=10)
myCycle.start()