TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Over-engineering an RGB LED strip: let’s make a custom programming language

105 pointsby misterdataalmost 3 years ago

12 comments

jedbergalmost 3 years ago
There already is a custom programming language for LED lights. It's called E1.31, and there are open source programs that exist to program in it (one of the most popular is called Xlights). It's what most people use to make their programable Christmas lights shows, and it also is the same protocol used in stage lighting.
评论 #32131710 未加载
solarkraftalmost 3 years ago
This is nice. I once tried to get programmatic animations running on MicroPython, but it seemed to fail to load even the simplest color conversion class (I didn&#x27;t have an ESP32 back then).<p>I also tried streaming patterns (could&#x27;ve been really cool to hook it up to something like ColorCord), but my Wifi connection was definitely also too unreliable for that (hmmm, what about PoE LED strips?).<p>There&#x27;s some project based on Javascript (I think) with in-browser previews for the patterns, but it&#x27;s proprietary and only sold as pre-flashed modules. I forgot the name, but I think it has been posted here.<p>This bytecode-custom-language solution definitely looks over-engineered (wish I could use a language I already know to make an animation), but damn, it should be efficient. I think I&#x27;ll play around with it bit.
评论 #32131830 未加载
dkerstenalmost 3 years ago
That’s pretty cool.<p>I did something similar once, where I wrote a Qt application that let you add effects to a timeline, which would get saved as json and could then be run on a Raspberry Pi to control a grid of NeoPixel LEDs. Each effect on the timeline has a start and length, which pixels it affected, RGBW colors, easing function in and out and effect type (fade, blink etc — there were a few basic effect types that could be combined to create more elaborate effects). The Qt application was able to simulate the LEDs in a GUI using the same code that ran on the RPi (just the GUI was replaced with LED driver code there). It was used to play animations on a t-shirt that was covered in a grid of LEDs made for a local musician. It was a fun project. The code is on GitHub but it’s terrible quality due to having been written over the space of 3 days and then never touched again: <a href="https:&#x2F;&#x2F;github.com&#x2F;danielytics&#x2F;ledstudio" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;danielytics&#x2F;ledstudio</a>
zmixalmost 3 years ago
On a sidenote: Can anyone recommend decent quality LED strips on Aliexpress or Ebay (I&#x27;m not in the US)? Points of interest would be:<p>* reproducable (when buyin two 10m strips of the same product, LED colors should match)<p>* lean (I read some reviews (Amazon), where the buyer experienced one or two LEDs in the strip having a different color temperature)<p>* etc.<p>I mainly want to equip the bottom edge of the kitchen cupboards with these, so I have better lighting, when cooking on the cutting board below them. I don&#x27;t need animation, just good light, ideally in different color temperatures and hues (dimmable). Thanks.
评论 #32134278 未加载
redfast00almost 3 years ago
Related: a multi-program programmable LED strip (in Lua, allows the led strip to be split up into multiple segments) <a href="https:&#x2F;&#x2F;zeus.gent&#x2F;blog&#x2F;21-22&#x2F;ledstrip_sandbox&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zeus.gent&#x2F;blog&#x2F;21-22&#x2F;ledstrip_sandbox&#x2F;</a> with the code on <a href="https:&#x2F;&#x2F;github.com&#x2F;ZeusWPI&#x2F;ledstrip_sandbox" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ZeusWPI&#x2F;ledstrip_sandbox</a>
评论 #32131547 未加载
garaetjjtealmost 3 years ago
I&#x27;m surprised you didn&#x27;t use floating point math, it seems cumbersome to make animations that way. My attempt at programmable LED strips used Lua (like that: <a href="https:&#x2F;&#x2F;gist.githubusercontent.com&#x2F;Milek7&#x2F;760a683f3480a4ff95c9377c1e9ef96b&#x2F;raw&#x2F;d83158e45eceda098961801552b5e352f52c32d4&#x2F;chasing.lua" rel="nofollow">https:&#x2F;&#x2F;gist.githubusercontent.com&#x2F;Milek7&#x2F;760a683f3480a4ff95...</a>), though they were driven directly from Linux SBC. <a href="https:&#x2F;&#x2F;milek7.pl&#x2F;.stuff&#x2F;26gru.webm" rel="nofollow">https:&#x2F;&#x2F;milek7.pl&#x2F;.stuff&#x2F;26gru.webm</a>
评论 #32131514 未加载
Tempest1981almost 3 years ago
How did you implement &quot;sleep&quot;? For timing the effects?<p>I see a &#x27;get_precise_time&#x27; command. I guess you could poll that, if you aren&#x27;t worried about power use. (LEDs using far more power than your CPU.)
评论 #32130945 未加载
flaviutalmost 3 years ago
This is very cool. And very generalizable, there are many situations where you want something like a scripting language for a MCU, and the VM implementation here is very straightforward.
natenatenate3almost 3 years ago
I&#x27;m surprised this one[0] hasn&#x27;t been mentioned, it is my favorite so far.<p>[0] <a href="https:&#x2F;&#x2F;kno.wled.ge&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kno.wled.ge&#x2F;</a><p>A fast and feature-rich implementation of an ESP8266&#x2F;ESP32 webserver to control NeoPixel (WS2812B, WS2811, SK6812) LEDs or also SPI based chipsets like the WS2801 and APA102!
评论 #32133356 未加载
manofmanysmilesalmost 3 years ago
This might interest you as well:<p><a href="https:&#x2F;&#x2F;www.bhencke.com&#x2F;pixelblaze" rel="nofollow">https:&#x2F;&#x2F;www.bhencke.com&#x2F;pixelblaze</a>
claxoalmost 3 years ago
Kudos to the author.<p>The readme links to a protocol.md that lives in a private repository, any posibility it gets copied to the github repo?
dtagamesalmost 3 years ago
You had me at Lua. It&#x27;s cool to think that runs on an RGB strip. I&#x27;d do it there but kudos on going all the way down!