-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customcolorschase #51
Conversation
Add ability to select custom colors for chase animation
Added CustomColorChase example. Updated All example with new CustomColorChase
Changed from customcolorchase to customcolorschase
Changed from customcolorchase to customcolorschase
Changed example CustomColorChase to CustomColorsChase
Change from CustomColorChase to CustomColorsChase
changed from customcolorchase to customcolorschase
fixed spaces before/after parameters
reformatted via black
reformatted via black
fixed "line too long" as indicated by pylint
I am working on reviewing your code. The current Pylint failure is not in your code. I am submitting a PR with the fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested these successfully with a Neopixel Featherwing, and with a 30 pixel strip. Really neat animation, thank you for adding it @cjsieh!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @cjsieh! Thanks so much for contributing this animation. I've tested it and it works successfully. There are a few changes I'd like to see before we merge it. Please see the suggestions below. Note: I committed a fix to a separate file that was causing Pylint to fail on a file you had not edited. The new Pylint failure is addressed in the comments below. Make sure you update your local version sequence.py
to match the new version in the PR.
With the new example, I think it would be better to choose some other nice color combinations and include them without themed names.
Let me know if you need any assistance with any of the changes. I'm happy to help!
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
""" | ||
`adafruit_led_animation.animation.rainbowchase` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated to match the module name, e.g. adafruit_led_animation.animation.customcolorchase
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
`adafruit_led_animation.animation.rainbowchase` | ||
================================================================================ | ||
|
||
Rainbow chase animation for CircuitPython helper library for LED animations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated to describe the module, e.g. Custom color chase animation for CircuitPython helper library for LED animations.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
from adafruit_led_animation.color import RAINBOW | ||
|
||
|
||
class CustomColorsChase(Chase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class names are typically singular. Please update this to CustomColorChase
. This will also require updating all subsequent use of the class name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
# Patriotic | ||
custom_colors_chase_rwb = CustomColorsChase( | ||
pixels, speed=0.1, colors=[RED, WHITE, BLUE], size=2, spacing=3 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a worldwide community and want everyone to feel welcome and included. Including this color combination under this name limits the scope of the example to the US, and could create a situation where users from elsewhere in the world, or even in the US, feel excluded. In light of the current climate, I feel it should be removed altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
custom_colors_chase_rwb = CustomColorsChase( | ||
pixels, speed=0.1, colors=[RED, WHITE, BLUE], size=2, spacing=3 | ||
) | ||
# St Pat Day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Associating these color combinations with holidays could be exclusionary as some do not celebrate them. The colors are fine, but please remove the holiday themed comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
) | ||
|
||
# colors default to RAINBOW | ||
custom_colors_chase_rainbow = CustomColorsChase(pixels, speed=0.1, size=2, spacing=3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would update this to custom_color_chase_rainbow
- removing the s
from colors
to match the class rename. Same suggestion goes for all instances of custom_colors
in this example.
@@ -43,6 +44,9 @@ | |||
rainbow_comet = RainbowComet(pixels, speed=0.1, tail_length=7, bounce=True) | |||
rainbow_chase = RainbowChase(pixels, speed=0.1, size=3, spacing=2, step=8) | |||
rainbow_sparkle = RainbowSparkle(pixels, speed=0.1, num_sparkles=15) | |||
custom_colors_chase = CustomColorsChase( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call this custom_color_chase
to match the class rename. (As well, the class name will need to be updated.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
@@ -57,6 +61,7 @@ | |||
rainbow_comet, | |||
sparkle_pulse, | |||
rainbow_chase, | |||
custom_colors_chase, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this to match, e.g. custom_color_chase
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
@@ -0,0 +1,61 @@ | |||
""" | |||
This example displays the basic animations in sequence, at a five second interval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment needs to be updated to describe the new example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
from adafruit_led_animation.animation.customcolorschase import CustomColorsChase | ||
from adafruit_led_animation.sequence import AnimationSequence | ||
from adafruit_led_animation.color import PINK, PURPLE, GREEN, RED, WHITE, BLUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PURPLE
is not used. If you do not intend to use it, please remove it from the imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
remove references to rainbowchase. Change customcolorschase to customcolorchase.
put in wrong place
Changed references to rainbowchase. Changed from CustomColorsChase to CustomColorChase
changed from customcolorschase to customcolorchase
change from CustomColorsChase to CustomColorChase
changed from ccustomcolorschase to customcolorchase
prefixed "black" formating
fixed description removed reference to advance_on_cycle_complete as not used now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates!
Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to 2.0.1 from 2.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_RFM9x#45 from jerryneedell/jerryn_size Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.3.1 from 2.3.0: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#51 from cjsieh/customcolorchase > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#52 from kattni/sequence-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 3.1.1 from 3.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#41 from brentru/example-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_NTP to 2.1.0 from 2.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_NTP#11 from theelectricmayhem/patch-1
Allow for a list of colors to be used with the Chase animation. New animation CustomColorsChase is provided with example. Issue#50 .