NeoRgbwXXFeature #618
-
Hello, I am looking at implementing a custom feature for 8-bit RGBW with an extra 16 bits of nothing padded to the end. So the total size of the packet should be 48 bits, hence the name RgbwXX. However I am mainly using this with WLED, and have been able to propagate data between the two systems. I went ahead and added the feature to NeoColorFeatures.h that inherits a "custom" Neo4ByteElementsNoSettings class. The reason it is custom is because I replaced the RgbwColor typedef with my own, RgbwXXColor that includes a uint16_t variable that I intend to set to 0. It is identical to RgbwColor other than the 16-bit extra variable.
Any suggestions? I only seem to get 32-bit output. Also, the order of the colors seems to come out incorrectly as well. When I add print statements inside applyPixelColor() R and W are always flipped. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
*ByteElements represent the number of actual bytes in the output stream to represent the "Pixel" (aka, single Item).
Get rid of your RgbwXXColor, you don't need it. Just use the standard RgbwColor object. |
Beta Was this translation helpful? Give feedback.
-
created an issue as to not loose this feature #677 |
Beta Was this translation helpful? Give feedback.
*ByteElements represent the number of actual bytes in the output stream to represent the "Pixel" (aka, single Item).
Your CustomNeo4ByteElements used 4 bytes when you need 6 bytes. This why the output was only 4 bytes.
See the standard Neo6ByteElements; copy it, name it Neo4Byte2BytePaddedElements, change the line within it from
typedef Rgb48Color ColorObject;
totypedef RgbwColor ColorObject
Merge this through the NoSettings object and NeoRgbwXXFeature (change the names to use the above naming, and case is important in the name, it should be NeoRgbwxxFeature))
In your NeoRgbwxxFeature , you need only the 4 bytes of the RGBW, but the last two bytes can just be constant zeros. Also is that…