Commit 78ebfb80 authored by Agrigor's avatar Agrigor

Revision 2019 effect added, kudos to madonius

parent c31f72fa
......@@ -269,18 +269,33 @@ class Revision2018(Effect):
class Revision2019(Effect):
def start(self):
self.values_dim = [(0.6 + 0.4 * sin(2 * pi / 36 * i)) for i in range(36)]
self.led_group_size = 3
self.values_dim = [(0.6 + 0.4 * sin(2 * i * pi / 36)) for i in range(36)]
self.values_led = [(x / 6) for x in range(1, 7)]
self.dim_led_groups = [
np.roll(self.values_dim,randint(0,35)) for x in range(self.led_group_size)
]
def setLED(self,led,led_group_size,luminosity,r=0,g=0,b=0):
self.jam.data[led:GLASSES_COUNT:led_group_size, :, 1] = [
int(r * luminosity * x) for x in self.values_led
]
self.jam.data[led:GLASSES_COUNT:led_group_size, :, 2] = [
int(g * luminosity * x) for x in self.values_led
]
self.jam.data[led:GLASSES_COUNT:led_group_size, :, 3] = [
int(b * luminosity * x) for x in self.values_led
]
def run(self):
self.jam.data[0:GLASSES_COUNT:2, :, 1] = [int(255 * self.values_dim[17] * x) for x in self.values_led]
self.jam.data[0:GLASSES_COUNT:2, :, 2] = [int(255 * self.values_dim[17] * x) for x in self.values_led]
self.jam.data[0:GLASSES_COUNT:2, :, 3] = [int(255 * self.values_dim[17] * x) for x in self.values_led]
self.jam.data[1:GLASSES_COUNT:2, :, 1] = [int(0x59 * self.values_dim[0] * x) for x in self.values_led]
self.jam.data[1:GLASSES_COUNT:2, :, 2] = [int(0xC3 * self.values_dim[0] * x) for x in self.values_led]
self.jam.data[1:GLASSES_COUNT:2, :, 3] = [int(0xD9 * self.values_dim[0] * x) for x in self.values_led]
self.setLED(0,self.led_group_size,self.dim_led_groups[0][0],0xFF,0xFF,0xFF)
self.setLED(1,self.led_group_size,self.dim_led_groups[1][0],0x59,0xC3,0xC9)
self.setLED(2,self.led_group_size,self.dim_led_groups[2][0],0x15,0xA6,0xE6)
self.jam.send(0.05)
self.values_dim = np.roll(self.values_dim, 1)
self.dim_led_groups = [
np.roll(self.dim_led_groups[x],1) for x in range(self.led_group_size)
]
self.values_led = np.roll(self.values_led, 1)
def end(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment