Fix PEP8 compliance and fix remapRange
MODIFY
Animated_NeoPixel_Glow_Fur_Scarf/Animated_NeoPixel_Glow_Fur_Scarf.py
Animated_NeoPixel_Glow_Fur_Scarf/Animated_NeoPixel_Glow_Fur_Scarf.py
@@ -79,11 +79,14 @@ def wheel(pos):
def remapRange(value, leftMin, leftMax, rightMin, rightMax):
- # this remaps a value from original (left) range to new (right) range
+ # this remaps a value fromhere original (left) range to new (right) range
# Figure out how 'wide' each range is
leftSpan = leftMax - leftMin
rightSpan = rightMax - rightMin
+ # Convert the left range into a 0-1 range (int)
+ valueScaled = int(value - leftMin) / int(leftSpan)
+
# Convert the 0-1 range into a value in the right range.
return int(rightMin + (valueScaled * rightSpan))
@@ -96,13 +99,14 @@ def shortkeypress(color_palette):
return color_palette
+
while True:
# check for button press
currkeystate = button.value
# button press, move to next pattern
- if (prevkeystate != True) and currkeystate:
+ if (prevkeystate is not True) and currkeystate:
ledmode = shortkeypress(ledmode)
# save button press state

Fix PEP8 compliance and fix remapRange