Fix pylint issues

This commit is contained in:
Craig Richardson 2018-05-14 17:03:40 +01:00
parent 707fa4ff24
commit 4bc3226be1

View file

@ -1,7 +1,9 @@
# UFO Flying Saucer with Circuit Playground Express """
# https://learn.adafruit.com/ufo-circuit-playground-express/ UFO Flying Saucer with Circuit Playground Express
# Plays UFO lights and sounds if the board is upside down only, https://learn.adafruit.com/ufo-circuit-playground-express/
# Tilt to change light color, cycle speed, tone pitch Plays UFO lights and sounds if the board is upside down only,
Tilt to change light color, cycle speed, tone pitch
"""
import time import time
@ -13,8 +15,9 @@ from adafruit_circuitplayground.express import cpx
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.8) pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.8)
def simpleCircle(wait, R, G, B): # timing, color values per channel def simple_circle(wait, red, green, blue):
baseFreq = int(20 + (G * 0.3)) # tone value derived from rotation """timing, color values per channel"""
baseFreq = int(20 + (green * 0.3)) # tone value derived from rotation
for i in range(10): for i in range(10):
pixels[i] = ((0, 0, 0)) pixels[i] = ((0, 0, 0))
@ -22,7 +25,7 @@ def simpleCircle(wait, R, G, B): # timing, color values per channel
time.sleep(wait) time.sleep(wait)
for i in range(10): for i in range(10):
pixels[i] = ((R, G, B)) pixels[i] = ((red, green, blue))
time.sleep(wait) time.sleep(wait)
@ -41,7 +44,7 @@ while True:
# check for upside down state on z axis # check for upside down state on z axis
if z < 0: # any negative number on z axis means it's upside down enough if z < 0: # any negative number on z axis means it's upside down enough
speed = (0.01 * (B * 0.025)) speed = (0.01 * (B * 0.025))
simpleCircle(speed, R, G, B) # speed based on tilt, .01 is good start simple_circle(speed, R, G, B) # speed based on tilt, .01 is good start
else: # right side up means no colors or sound! else: # right side up means no colors or sound!
pixels.fill((0, 0, 0)) pixels.fill((0, 0, 0))