Conversation
Hermanoid
left a comment
There was a problem hiding this comment.
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.
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.
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): |
| tempB = self.rainbowB | ||
|
|
||
| # Assigning LED RGB values | ||
| for i in range(NUM_LIGHTS): |
There was a problem hiding this comment.
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.
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