Compare commits
2 Commits
master
...
feat/chris
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14ec691c13 | ||
|
|
081ace80c9 |
@@ -1,7 +1,7 @@
|
|||||||
from lib.Config import Config
|
from pyleds.lib.Config import Config
|
||||||
from lib.LoopSwitch import LoopSwitch
|
from pyleds.lib.LoopSwitch import LoopSwitch
|
||||||
from lib.Regions import Regions
|
from pyleds.lib.Regions import Regions
|
||||||
from lib.Tempo import Tempo
|
from pyleds.lib.Tempo import Tempo
|
||||||
|
|
||||||
|
|
||||||
class Litsimaja(object):
|
class Litsimaja(object):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from lib.Litsimaja import Litsimaja
|
from pyleds.lib.Litsimaja import Litsimaja
|
||||||
from lib.LoopSwitch import LoopSwitch
|
from pyleds.lib.LoopSwitch import LoopSwitch
|
||||||
|
|
||||||
|
|
||||||
class Program:
|
class Program:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from os import scandir
|
from os import scandir
|
||||||
from lib.Litsimaja import Litsimaja
|
from pyleds.lib.Litsimaja import Litsimaja
|
||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
|
|
||||||
|
|
||||||
def resolve(namespace: str, class_name: str):
|
def resolve(namespace: str, class_name: str):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import atexit
|
import atexit
|
||||||
from lib.Color import Color
|
from pyleds.lib.Color import Color
|
||||||
|
|
||||||
|
|
||||||
class _LedData(object):
|
class _LedData(object):
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
from tkinter import Tk, Label
|
from tkinter import Tk, Label
|
||||||
from .FakeStrip import FakeStrip
|
from FakeStrip import FakeStrip
|
||||||
from lib.Color import Color_to_list
|
from pyleds.lib.Color import Color_to_list
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image, ImageTk
|
from PIL import Image, ImageTk
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
from tkinter import Tk, Canvas
|
from tkinter import Tk, Canvas
|
||||||
from lib.strip.FakeStrip import FakeStrip
|
from pyleds.lib.strip.FakeStrip import FakeStrip
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
from lib.Program import Program
|
|
||||||
|
|
||||||
def name():
|
|
||||||
return '2-color strips'
|
|
||||||
|
|
||||||
class Strips(Program):
|
|
||||||
def run(self, args = None) -> None:
|
|
||||||
for i in range(self._lm.count_pixels()):
|
|
||||||
if i // 5 % 2:
|
|
||||||
color = (255, 255, 255)
|
|
||||||
else:
|
|
||||||
color = args['color']
|
|
||||||
self._lm.set_pixel_color(i, (color[0] << 16) | (color[1] << 8) | color[2])
|
|
||||||
self._lm.show()
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# Ported by Peter
|
# Ported by Peter
|
||||||
# Palun!
|
# Palun!
|
||||||
|
|
||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Mis m6tted tulevad kui kuuled "MegaMix"?
|
# Mis m6tted tulevad kui kuuled "MegaMix"?
|
||||||
# m6tlen et millal jooma saaks hakata
|
# m6tlen et millal jooma saaks hakata
|
||||||
|
|
||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
from rpi_ws281x import Color
|
from rpi_ws281x import Color
|
||||||
import time
|
import time
|
||||||
|
|
||||||
def name():
|
def name():
|
||||||
return 'Christmas Lights'
|
return 'Christmas Lights'
|
||||||
|
|
||||||
class ChristmasLights(Program):
|
class Christmas(Program):
|
||||||
def run(self, args: [] = None):
|
def run(self, args: [] = None):
|
||||||
# Configuration
|
# Configuration
|
||||||
wait_ms = 0 # Speed of the animation
|
wait_ms = 100 # Speed of the animation
|
||||||
|
|
||||||
# Define classic festive colors
|
# Define classic festive colors
|
||||||
RED = Color(255, 0, 0)
|
RED = Color(255, 0, 0)
|
||||||
@@ -34,5 +34,5 @@ class ChristmasLights(Program):
|
|||||||
|
|
||||||
# Increment offset to move the lights
|
# Increment offset to move the lights
|
||||||
offset = (offset + 1) % (len(colors) * group_size)
|
offset = (offset + 1) % (len(colors) * group_size)
|
||||||
self._lm.get_tempo().wait()
|
|
||||||
time.sleep(wait_ms / 1000.0)
|
time.sleep(wait_ms / 1000.0)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
from rpi_ws281x import Color
|
from rpi_ws281x import Color
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
|
|
||||||
|
|
||||||
def name():
|
def name():
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
from lib.Program import Program
|
|
||||||
from rpi_ws281x import Color
|
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
def name():
|
|
||||||
return 'Vikermasetsus'
|
|
||||||
|
|
||||||
|
|
||||||
def wheel(pos):
|
|
||||||
"""Generate rainbow colors across 0-255 positions."""
|
|
||||||
if pos < 85:
|
|
||||||
return Color(pos * 3, 255 - pos * 3, 0)
|
|
||||||
elif pos < 170:
|
|
||||||
pos -= 85
|
|
||||||
return Color(255 - pos * 3, 0, pos * 3)
|
|
||||||
else:
|
|
||||||
pos -= 170
|
|
||||||
return Color(0, pos * 3, 255 - pos * 3)
|
|
||||||
|
|
||||||
|
|
||||||
class Vikermasetsus(Program):
|
|
||||||
def run(self, args: [] = None):
|
|
||||||
wait_ms = 20
|
|
||||||
iterations = 5
|
|
||||||
while self.get_loop().status():
|
|
||||||
"""Draw rainbow that uniformly distributes itself across all pixels."""
|
|
||||||
for j in range(256 * iterations):
|
|
||||||
if not self.get_loop().status():
|
|
||||||
break
|
|
||||||
for i in range(self._lm.count_pixels()):
|
|
||||||
self._lm.set_pixel_color(i, wheel(
|
|
||||||
(int(i * 2560 / self._lm.count_pixels()) + j) & 255))
|
|
||||||
self._lm.show()
|
|
||||||
time.sleep(wait_ms / 1000.0)
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
from lib.Program import Program
|
from pyleds.lib.Program import Program
|
||||||
from lib.Litsimaja import Litsimaja
|
from pyleds.lib.Litsimaja import Litsimaja
|
||||||
|
|
||||||
|
|
||||||
def Color(red, green, blue):
|
def Color(red, green, blue):
|
||||||
|
|||||||
Reference in New Issue
Block a user