flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > color encoding for ws2812, MCU and why not, x86

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4256
Location: Now
edfed
I am playing with ws2812, ATmega328 with arduino IDE (shame on me)
I use adafruit neopixel lib(shame on me)
and now, i meet a real limit... a need more ram. but i don't need more ram.

in this lib, they use 32 or 24 bits per pixel, but i don't need that much bits.

then, I want to modify this lib and then have a 8 bits per pixel encoding.

my idea is to split the byte in 2 nibbles, the first will be the color, and the second will be the light.

and the resulting palette is this:
Image

i don't find anything about. then, what do you think about it?


Description:
Filesize: 1023 Bytes
Viewed: 109 Time(s)

new 8bits palette.png


Post 22 Jan 2022, 00:29
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18264
Location: In your JS exploiting you and your system
revolution
Would a 3:3:2 distribution give more colour choices?

You could use either RGB or YUV encoding for the bit fields.
Post 22 Jan 2022, 02:44
View user's profile Send private message Visit poster's website Reply with quote
FlierMate



Joined: 21 Jan 2021
Posts: 169
FlierMate
LED stick can be fun! I use WS2318 with ATmega328P, to create an audio visualizer:

Image
Post 22 Jan 2022, 09:17
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4256
Location: Now
edfed
the asm part of the adafruit lib is very timing related due to the rnz protocol of the leds.
of course, there can be some fluctuations amoung the timing specifications. then, a palette encoded in the program flash memory would be the solution to lookup the 24 bits with the constant timing needed.

and then, the programmer can compose any palette, as it is in mode 13h
Post 24 Jan 2022, 11:27
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.