def wave(led_max=150, frame_delay=0.02, frame_count=None, initial_brightness=None, direction=None):
Creates a wave effect through the PiGlow board.
Args (all are optional):
led_max (int): the LED brightness at the peak of the wave.
frame_delay (float): the time between each transition.
frame_count (int): the number of transitions in a single wave.
initial_brightness (int): the current brightness of the LEDs.
direction (string): either 'inward' or 'outward'.
if initial_brightness is None:
initial_brightness = min(piglow.get())
if direction is None:
direction = "outward"
if frame_count is None:
frame_count = len(LEDS)
if direction == "outward":
led_set_count = len(LEDS)
# initialise all of the LEDs
wave = _create_led_sine_wave(led_max, frame_count, initial_brightness, led_set_count)
for wave_point in _window(wave, led_set_count):
for i, led_set in enumerate(LEDS):
for led in led_set: