Skip to content

4. Creating Scenes

Larry Athey edited this page Oct 25, 2026 · 34 revisions

RGB LED Scenes are nothing more than scripts written in the LedBasic language which is a super stripped down version of BASIC with line numbers that you may have learned in the 1980s on an old Commodore 64. There are only handful of extra functions and variables added to it that are specific to working with RGB LEDs.

I used BASIC with line numbers starting in 1980 up through 1992 when I finally got my first IBM 286 and switched to Pascal. I still think BASIC is the best beginner's programming language because it naturally teaches a person how CPU instructions flow and how code routines can jump from one place to another.

Here's a great beginner-friendly BASIC programming tutorial. It covers more than what LedBasic does, but it'll help a 100% newbie get their wheels on the ground and rolling. You'll be programming like it's 1982 again in 30 minutes!

In LedBasic, all you really need to know about the BASIC language is IF logic, FOR loops, and GOTO/GOSUB branching. The rest of LedBasic pretty much exists in 10 custom functions/variables. I would have used Python or Lua for this, but I like to "keep it stupid simple" and LedBasic was the better fit in this case.

Granted, there are more functions in LedBasic than that, but they are only worth worrying about when you actually need them. There is a convenient Language Reference button at the bottom of the editor to help you with these functions when you need them.

image

Planning Your Scenes

While you may think that creating scenes is complicated, it really isn't. Everything you do in life can be documented in mathematical steps and RGB LED scenes are no different. Even if you were watching a video of a person sorting a dozen Easter eggs by color, you could document the entire procedure in mathematical steps, starting with a FOR X = 1 TO 12 loop.

Let's say that you have four RGB LED strips with 30 LEDs each, connected end to end, and you want to position them in a pyramid formation so you can light the pyramid incrementally from the bottom-up. The first LED in each strip has an address/offset and you just need to create four variables that point to the first LED in each strip.

10 A = 0
20 B = 30
30 C = 60
40 D = 90

Then create a FOR / NEXT loop that counts from 1 to 30 to set their color and light them up, then increment each variable and repeat the process. We'll set each LED to blue at half brightness and wait 1000 ms between each one.

50 FOR X = 1 TO 30
60   SET A, 0, 0, 127
70   SET B, 0, 0, 127
80   SET C, 0, 0, 127
90   SET D, 0, 0, 127
100  WAIT 1000
110  A = A + 1
120  B = B + 1
130  C = C + 1
140  D = D + 1
150 NEXT X

That's all there is to it!

Even though this is just a simplistic scene, this demonstrates a realistic way of working with RGB LED strip lights and dealing with each LED on an individual basis. Be sure to look at the other example scenes and refer to the Language Reference if you don't understand what they're doing on a specific line of code.

Let's say that you're working with a dining room that has 20 RGB LED light fixtures in the ceiling and you want to turn them all on at the same time. Do you want to create 20 RGB LED commands in your command library and send two command scripts with a noticeable delay before the last 4 lights turn on? Or do you want to create a FOR X = 1 to 20 loop in a scene and create one command to send that scene instead?

As with any other scripting or programming language, LedBasic will become second nature to you and creating scenes will become the first thing you reach for any time that you're dealing with more than one RGB LED.

PRO TIP: Create a command library record that runs your test/development LedBasic scene and add it as a favorite command to a device to make scene testing easier. This eliminates the need to use the green CTRL button and hunt for your scene in order to send it to your LCC Slave. Keep Mission Control running in 2 browser tabs and that will make things even easier yet.

Clone this wiki locally