From 0bd7385a20701ad1775aa73703717c2b89961014 Mon Sep 17 00:00:00 2001 From: Scott Lawson Date: Wed, 12 Oct 2016 16:02:06 -0700 Subject: [PATCH] Added missing lookup table, fixed pep8 formatting Added lookup_table.npy which was missing from the previous commit. The led.py module uses this table to do LED brightness gamma correction. Fixed formatting for pep8 compliance --- python/led.py | 5 +++-- python/lookup_table.npy | Bin 0 -> 1104 bytes 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 python/lookup_table.npy diff --git a/python/led.py b/python/led.py index 51276fb..a228b5c 100644 --- a/python/led.py +++ b/python/led.py @@ -63,14 +63,15 @@ def rainbow(brightness=255.0, speed=1.0, fps=10): def g(t): return (np.sin(t + (2.0 / 3.0) * np.pi) + 1.0) * brightness / 2.0 + offset def b(t): return (np.sin(t + (4.0 / 3.0) * np.pi) + 1.0) * brightness / 2.0 + offset while True: - t = time.time()*speed + t = time.time() * speed for n in range(N_pixels): T = t + n * dt set_pixel(N=n, R=r(T), G=g(T), B=b(T)) update_pixels() time.sleep(1.0 / fps) + if __name__ == '__main__': for i in range(N_pixels): set_all(0, 0, 0) - #rainbow(speed=0.025, fps=40, brightness=0) + # rainbow(speed=0.025, fps=40, brightness=0) diff --git a/python/lookup_table.npy b/python/lookup_table.npy new file mode 100644 index 0000000000000000000000000000000000000000..17cec45ca3644971924a6c5dd37bb022a2b29ded GIT binary patch literal 1104 zcmbWyd4yGA7zf}x?fbqjIw_q-S2CuNF%oGa(?-b<mrBlVxB$X51-oB>Le<&sZ-R=^g7M`^Ngo{;>gaAcGjp5QZ|0;f!D; zqZrK?0>(0q@k}73m`S9W%oIu}rHpBmQ^9m*Fq2u#W)4-%XCaGNLN!aNVHsIgvW9ik zQD7sR*uplpvxA-NVmEu($9@iQkV72i2uC@_aZXUrNltN^Gc?f1S