diff --git a/Labo_Piano_Light_FX/code.py b/Labo_Piano_Light_FX/code.py index 1fe0d066..0dafa742 100644 --- a/Labo_Piano_Light_FX/code.py +++ b/Labo_Piano_Light_FX/code.py @@ -24,9 +24,9 @@ def wheel(pos): # The colours are a transition r - g - b - back to r. if (pos < 0) or (pos > 255): return (0, 0, 0) - if (pos < 85): + if pos < 85: return (int(pos * 3), int(255 - (pos * 3)), 0) - elif (pos < 170): + elif pos < 170: pos -= 85 return (int(255 - pos * 3), 0, int(pos * 3)) else: @@ -58,7 +58,7 @@ while True: n = int((mic_pin.value / 65536) * 1000) # 10-bit ADC format n = abs(n - 512 - dc_offset) # Center on zero - if (n >= noise): # Remove noise/hum + if n >= noise: # Remove noise/hum n = n - noise # "Dampened" reading (else looks twitchy) - divide by 8 (2^3)