Author Topic: Issues with DotStar HSV colors  (Read 644 times)

0 Members and 1 Guest are viewing this topic.

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Issues with DotStar HSV colors
« on: June 13, 2022, 09:34:38 pm »
I'm trying to get a dotstar strip working and I'd like to use HSV because it will make shifting the hue to nearby colors and also the brightness easier than RGB. I'm having trouble though with the picking of the correct hue numbers for colors. I'm looking at the image under HSV here https://learn.adafruit.com/adafruit-dotstar-leds/arduino-library-use and trying to put in the numbers that it would expect.

10922 gave me a yellow. 21845 did not give me green, and a number around 34000 did not give me a blue/teal color. I can't figure out what numbers I should use to get the correct colors.

This my color assignment line:
Code: [Select]
uint32_t colorWave = strip.ColorHSV(21845, 255, 255);
Anybody figured this out?
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12573
  • Country: ch
Re: Issues with DotStar HSV colors
« Reply #1 on: June 13, 2022, 10:27:50 pm »
Are you sure your LEDs use the default byte order for the colors? As stated farther down the page, the different manufacturers (or even batches) of these things don’t always use the same order for RGB, so you can set the order via a parameter. You can test what you’ve got by writing pure red, green, and blue and seeing what comes out.

P.S. You might want to try the FastLED library instead of Adafruit’s. It has much more robust HSV support, as well as specific functions for performing math on the colors (like brightness or hue). https://github.com/FastLED/FastLED/wiki/Pixel-reference#chsv
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Issues with DotStar HSV colors
« Reply #2 on: June 14, 2022, 03:47:27 am »
OK thanks for the info. I'll check out the fastLED and also check the color order.
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Issues with DotStar HSV colors
« Reply #3 on: June 19, 2022, 04:11:33 am »
Are you sure your LEDs use the default byte order for the colors?

Turns out I needed DOTSTAR_GBR to work correctly. Thanks.
 
The following users thanked this post: tooki

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12573
  • Country: ch
Re: Issues with DotStar HSV colors
« Reply #4 on: June 19, 2022, 12:39:10 pm »
Glad to help!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf