You are on page 1of 2

import time

# Import necessary modules for controlling lights and smoke machine

# Initialize spider lights


light1 = RGBSpiderLight(brightness=100, rotation_speed=3)
light2 = RGBSpiderLight(brightness=100, rotation_speed=3)

# Initialize disco ball


disco_ball = RGBDiscoBall(rotation_speed=5)

# Initialize strobes
strobe1 = RGBStrobe(flash_rate=5)
strobe2 = RGBStrobe(flash_rate=5)
strobe3 = SingleColorStrobe(color="blue", flash_rate=5)

# Initialize laser
laser = RGBLaser(5 effects, brightness=100)

# Initialize smoke machine


smoke_machine = SmokeMachine()

# Define color sequences for each light


light1_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
light2_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
disco_ball_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
strobe1_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
strobe2_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
laser_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]

# Define timing for color sequences


light1_timing = [1, 2, 4] # seconds
light2_timing = [2, 1, 4] # seconds
disco_ball_timing = [1, 2, 4] # seconds
strobe1_timing = [1, 2, 4] # seconds
strobe2_timing = [2, 1, 4] # seconds
laser_timing = [1, 2, 4] # seconds

# Define timing for laser effects


laser_effect_timing = [4, 4, 4, 4, 4] # seconds

# Define timing for smoke


smoke_timing = [1, 2, 4] # seconds

# Begin lighting show


while True:

# Start song
start_song("nathan dawe - flowers.mp3")
# wait for song to start
time.sleep(1)

# Cycle through color sequences for each light


for i in range(len(light1_colors)):
light1.set_color(light1_colors[i])
light2.set_color(light2_colors[i])
disco_ball.set_color(disco_ball_colors[i])
strobe1.set_color(strobe1_colors[i])
strobe2.set_color(strobe2_colors[i])
laser.set_color(laser_colors[i])

# Move spider lights in opposite directions


light1.rotate_clockwise()
light2.rotate_counterclockwise()

# Make disco ball rotate


disco_ball.rotate()

# Make strobes flash


strobe1.flash()
strobe2.flash()
strobe3.flash()

# Emit smoke at specific timing


if smoke_timing[i] == time_elapsed:
smoke_machine.emit_smoke()

# Wait for the set amount of time before changing colors


time.sleep(light1_timing[i])

# Cycle through laser effects


for i in range(len(laser.effects)):
laser.set_effect(laser.effects[i])

# Emit smoke at specific timing


if smoke_timing[i] == time_elapsed:
smoke_machine.emit_smoke()

# Wait for the set amount of time before changing effects


time.sleep(laser_effect_timing[i])
# After one full iteration of effects, hold the final laser effect and pause
for 5 seconds
time.sleep(5)

You might also like