From 85d7628b537b1c05487badf1b16dd476e3a963bd Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Wed, 1 Aug 2018 15:29:14 -0400 Subject: [PATCH 1/2] Fix for pylint --- examples/pixels_simpletest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/pixels_simpletest.py b/examples/pixels_simpletest.py index 8c7063f..7b4624e 100644 --- a/examples/pixels_simpletest.py +++ b/examples/pixels_simpletest.py @@ -14,10 +14,9 @@ def wheel(pos): return (0, 0, 0) if pos < 85: return (int(pos * 3), int(255 - (pos*3)), 0) - elif pos < 170: + if pos < 170: pos -= 85 return (int(255 - pos*3), 0, int(pos*3)) - #else: pos -= 170 return (0, int(pos*3), int(255 - pos*3)) From 2a4e81457540c4e14774786be55c4ac0e400065e Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Fri, 3 Aug 2018 14:43:30 -0400 Subject: [PATCH 2/2] Linting. --- .travis.yml | 1 + examples/pixels_simpletest.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dd88629..257f5bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ deploy: install: - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme + - pip install --force-reinstall pylint==1.9.2 script: - pylint adafruit_circuitplayground/*.py diff --git a/examples/pixels_simpletest.py b/examples/pixels_simpletest.py index 7b4624e..c2af9ae 100644 --- a/examples/pixels_simpletest.py +++ b/examples/pixels_simpletest.py @@ -3,10 +3,10 @@ import time from adafruit_circuitplayground.express import cpx - # The number of pixels in the strip numpix = 10 + def wheel(pos): # Input a value 0 to 255 to get a color value. # The colours are a transition r - g - b - back to r. @@ -20,6 +20,7 @@ def wheel(pos): pos -= 170 return (0, int(pos*3), int(255 - pos*3)) + def rainbow_cycle(wait): for j in range(255): for i in range(cpx.pixels.n): @@ -28,6 +29,7 @@ def rainbow_cycle(wait): cpx.pixels.show() time.sleep(wait) + cpx.pixels.auto_write = False cpx.pixels.brightness = 0.3 while True: