LED optimization using gamma correction

This commit is contained in:
Scott Lawson 2016-11-11 15:51:41 -08:00
parent ffbec2901f
commit 7aa12f17ed
1 changed files with 2 additions and 2 deletions

View File

@ -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))