Skip to content

Commit 0c896b1

Browse files
committed
LED experiment (to be moved to plugin)
1 parent 76680c4 commit 0c896b1

File tree

2 files changed

+252
-225
lines changed

2 files changed

+252
-225
lines changed

src/core.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
from src.articulation import Articulation
1919
# from src.gamepad import Gamepad
2020

21+
LEDS = False
22+
if LEDS:
23+
from src.leds import LEDGridDisplay
24+
print(LEDGridDisplay)
25+
2126
with open(os.devnull, "w") as devnull:
2227
# suppress pygame messages (to keep console output clean)
2328
stdout = sys.stdout
@@ -1836,12 +1841,12 @@ def __init__(self):
18361841
# self.test()
18371842

18381843
self.leds = None
1839-
# try:
1840-
# from src.leds import LEDGridInterface
1841-
# self.leds = LEDGridInterface()
1842-
# print("LEDs initialized")
1843-
# except Exception as e:
1844-
# print("LEDs not initialized: ", e)
1844+
if LEDS:
1845+
try:
1846+
self.leds = LEDGridDisplay()
1847+
print("LEDs initialized")
1848+
except Exception as e:
1849+
print("LEDs not initialized: ", e)
18451850

18461851
def midi_mode_rpn(self, on=True):
18471852
if on:
@@ -2410,7 +2415,7 @@ def render(self):
24102415
if self.leds:
24112416
if cell:
24122417
lit = glm.vec3(1,1,1)
2413-
self.leds.put(lit, x, y)
2418+
self.leds.put(lit, x, y, 2)
24142419
# self.leds.put(red, x*2+1, y*2)
24152420
# self.leds.put(red, x*2+1, y*2+1)
24162421
# self.leds.put(red, x*2, y*2+1)
@@ -2425,7 +2430,7 @@ def render(self):
24252430
# r, g, b = colorsys.hsv_to_rgb(h, s, v)
24262431
# colf = glm.vec3(r, g, b)
24272432

2428-
self.leds.put(colf, x, y)
2433+
self.leds.put(colf, x, y, 2)
24292434
# self.leds.put(colf, x*2+1, y*2)
24302435
# self.leds.put(colf / 2, x*2+1, y*2+1)
24312436
# self.leds.put(colf / 2, x*2, y*2+1)

0 commit comments

Comments
 (0)