I've recommended to enough people to use HSV colorspace instead of RGB for various projects that I thought it was time I took code I used and made it into a library.
https://github.com/aedile/LEDHSV
I'm not a C++ programmer at all (many other languages, though), so I'm not 100% sure if I'm breaking any fundamental rules or not. This is all based on trial and error (and help from cplusplus.com). If anybody has the time and the inclination, I'd love it if I could get some help testing/reviewing the code. There is an example sketch that uses three LEDs and a button to test the basic functionality. Here is a link to a video of the sketch running (it's a little washed out even though I set the brightness almost to zero, anybody have tips on filming LEDs?).
https://www.youtube.com/watch?v=ZnVeqdcNfQk
Also in the repository is auto-generated docs based on javadoc blocks. So far it's all worked pretty well, but I haven't done much beyond test it with 3 common cathode and then 3 common anode LEDs, all on a Teensy 2.0++. On my agenda is to test with a TLC5940 soon.
If you get around to playing with it and have suggestions, please don't hesitate to let me know here in a reply. Thanks very much in advance!
https://github.com/aedile/LEDHSV
I'm not a C++ programmer at all (many other languages, though), so I'm not 100% sure if I'm breaking any fundamental rules or not. This is all based on trial and error (and help from cplusplus.com). If anybody has the time and the inclination, I'd love it if I could get some help testing/reviewing the code. There is an example sketch that uses three LEDs and a button to test the basic functionality. Here is a link to a video of the sketch running (it's a little washed out even though I set the brightness almost to zero, anybody have tips on filming LEDs?).
https://www.youtube.com/watch?v=ZnVeqdcNfQk
Also in the repository is auto-generated docs based on javadoc blocks. So far it's all worked pretty well, but I haven't done much beyond test it with 3 common cathode and then 3 common anode LEDs, all on a Teensy 2.0++. On my agenda is to test with a TLC5940 soon.
If you get around to playing with it and have suggestions, please don't hesitate to let me know here in a reply. Thanks very much in advance!