From 7aa12f17ed1ee40b9b541439ae0995421e80f372 Mon Sep 17 00:00:00 2001 From: Scott Lawson Date: Fri, 11 Nov 2016 15:51:41 -0800 Subject: [PATCH] LED optimization using gamma correction --- python/led.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/led.py b/python/led.py index f42d36f..4632e2e 100644 --- a/python/led.py +++ b/python/led.py @@ -18,10 +18,10 @@ def update(): p = _gamma[pixels] if config.GAMMA_CORRECTION else np.copy(pixels) for i in range(config.N_PIXELS): # Ignore pixels if they haven't changed (saves bandwidth) - if np.array_equal(pixels[i], _prev_pixels[i]): + if np.array_equal(p[i], _prev_pixels[i]): continue m += chr(i) + chr(p[i][0]) + chr(p[i][1]) + chr(p[i][2]) - _prev_pixels = np.copy(pixels) + _prev_pixels = np.copy(p) _sock.sendto(m, (config.UDP_IP, config.UDP_PORT))