-
Notifications
You must be signed in to change notification settings - Fork 0
Led strip #58
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
Led strip #58
Conversation
Hermanoid
left a comment
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.
Some cleaning stuff and a suggestion to use HSV for nicer rainbows :))
| self.ledColor = msgs[0] | ||
| self.get_logger().info('New color received: %s' % msgs[0]) | ||
| self.animations[self.currentAnimation](self.colors[msgs[0]]) | ||
|
|
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.
Add a last case here which handles if it's "none of the above", aka an invalid message. Print out a something like "oi butt face you entered [blank] and that's wrong" - feel free to quote me
| if len(msgs) == 2: | ||
| try: | ||
| brightness = float(msgs[1]) | ||
| if brightness > 1.0: |
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.
use the fancy min(max_bound, max(min_bound, number)) method
|
|
||
| def pulse(color, wait=0.1): | ||
| PIXELS.fill(color) | ||
| def rainbow_cycle(self, color, wait=0.1): |
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.
ewwwww
| tempB = self.rainbowB | ||
|
|
||
| # Assigning LED RGB values | ||
| for i in range(NUM_LIGHTS): |
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.
You couuuuld use HSV and cycle through Hues if you so chose.. colorsys has a thing for that and I think it's in the standard library (so no extra dependency)
|
@Sodapop465 Get to work good buddy |
…id anim, off anim
yameatmeyourdead
left a comment
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.
Minor changes could be made to make this nicer to use, but thats forward work. good to merge into main
|
bypassing lucas review |
|
can reliably crash this by sending a get_colors or get_animations now |
Implemented WS2812 LEDs Jetson Library