How to use RGB20

RGB20 uses Bluetooth to send design data to your AVR or Arduino, which in turn controls the RGB LEDS. The design is sent once, which takes a second or less depending on the design complexity and the baud rate between your Bluetooth module and your AVR, and then your AVR will continue to send data to your LEDs until you load another file, edit the current design, etc.

The hardware

This website has links to the circuit diagram and the code to run in your AVR. Any Bluetooth adapter that uses SPP should work with most Android devices, except for some of the newer types like HC-08 that might not work with older Androids. Do some Google research to find an adapter that will work with the API in your device. The code listed for the AVR is what I use, and I use an assembler and Avrdude to program my devices. I'm not familiar with the Arduino IDE, but it appears that if you are using it successfully, then you have everything you need to load the hex file into your AVR; Google a bit to find the details.

All the files are very similar. The main difference between my UNO and 2560 files is the pin used to drive the LEDs and the UART registers. If you want a baud rate not covered by my files, it's easy to change one byte in init_uart to get any baud rate the AVR can use. The important point is that your Bluetooth adapter and your AVR have to have the same settings for baud rate, parity bits, etc.

Before starting the app you should enable Bluetooth on your Android and pair it with your adapter. The app has a Bluetooth icon at the upper right which you use to "Connect a device - Insecure". After a second or so, it should say that it is connected, or has failed. Assuming it succeeds, if your Android is connected to the web, you can tap "get next web design" at the lower right, and a design should be downloaded and sent to your AVR within a second or so. (The default number of LEDs is 60. If you have more or less, go to Design - Change Led Count and enter the correct value. A wrong value won't hurt anything, it will just look wrong if you have more than 60, and will waste resources if you have fewer.) The other buttons on the home screen should be self-explanatory.

Design is the fun part

The first screen is the Profile screen, and it might take a bit to understand it. The top plot has a pale grey line for each LED. The horizontal or slanted lines are the initial state for each LED. Tap the three dots in the upper right menu, then Actions - Zero All. This will put a horizontal line across the upper plot, and your LEDs will all be synchronized to the same color state. Now touch the plot and drag the line up or down. This changes the initial states so that your LEDs appear to have motion. Play around with this feature a while. Actions - Remove Anchor will undo the last one you touched (it will be green). You can also Remove All Anchors, or Zero All as you have already seen. The two endpoints can be dragged up and down, but you might have to stretch the plot wider to make the app do what you want. And, you cannot drag two adjacent LED lines - there always has to be one LED between two adjacent red lines (anchors).

The lower plot on the profile screen shows the color schemes for each LED, and is displayed just as a reference and does not respond to touches except when you stretch or pinch horizontally. It's mostly useful when you have more than one color scheme in your string of LEDS, which is seen in Mode - Color Schemes. But before you can do anything there, you need to have a second color scheme, so go to Mode - Pick Color.

In the Pick Color screen, there will usually be one color at the right which has a zero beneath it, meaning that it is currently not used in any LED. This color or colors came from the last file you loaded from the web or your local storage, which gives you a way to copy a color scheme from one design file to another. You can also use the menu Actions - Add New to create another color scheme, or Actions - Copy Selected to make a duplicate of the selected scheme, which is indicated by a white border around each color state in the color scheme. Go to Mode - Edit Color now.

Edit color has three sliders on the left to quickly change the red, green and blue values for the selected color state, along with a '+' box and a '-' box to change the value by one. Touch the color bars on the right to select the state you wish to edit. Each color state has a Hold and a Blend value, and the sum of these two is limited to 255. "Hold" means that for this many frames the color does not change. "Blend" means to use this many frames to smoothly transition to the next color state. Once the color state at the bottom is done, it starts over at the top. If you want a color to Hold for more time, simply duplicate it by tapping it so that it's the selected state, then tap the "+" box to make copies.

You can have a lot of color states. I need to go check the app, but at any rate you can have more than you need. Also, you can exceed your AVR's SRAM if you have too many color schemes and color states; nothing bad will happen, but the design will cause a RESET and the default crap design will be played. If you do have lots of states, you might need to stretch the color states vertically in order to tap the one you want. Some of the online designs have lots of color states because I created them on an early version of this app that did not have Blend frames, so please don't look at them and think it's a good way to design. If I were making the same designs today, I'd probably have no more than five or ten states. Also, if you have a 2560 AVR with lots of SRAM and you make really complex designs, that's ok, but if you upload them, people with UNOs won't get to see your nice work. I might add a feature to the app to notify you when your design exceeds the UNO SRAM, and perhaps the web server code will be changed to only send designs that your system can handle.

So now that you've Picked a color, and Edited it, go to Mode - Color Scheme. Here you can tap an LED and it will change to the new color, or you can tap another LED and Actions - Apply to Range, or you can also Actions - Apply to All. If you have lots of LEDs, you might need to stretch the plot horizontally to tap the LED you want. You can stretch by placing your fingers in the blank space at the top of the screen to avoid setting the wrong LED.

The app is curently limited to 84 (85) LEDs. That's because one or more counters in the AVR code use one byte, and each LED has three colors, so 255 / 3 = 85. This could be changed in the future, or one of you might want to edit the ASM files. The current AVR code updates the LEDs about 360 times per second, which was chosen because 85 LEDs can barely be controlled at that rate, so the frame rate will have to be reduced for LED counts above 85. Another aspect of this is that a disk of plexiglass much larger than 12 inches diameter tends to have a dull washed out looking area at the center, so if you went to 200 LEDs or whatever, you might not like the result. And as for linear designs, I tried that and was not impressed; if I wanted an LED strip to go around my room I'd probably look at one of the commercial controllers rather than this app because the effects that RGB20 is good at were not very appealing (to me) on a straight piece of plexiglass. However, the AVR code could easily be modified to handle a lot more LEDs at a reasonable frame rate.

Playlists

When you create a Playlist, you can use it to play those designs over and over, with the duration for a design being whatever number of seconds you specify. I used to think this was useful, but normally i use Playlist - All My Files which does what it says. Since I get rid of files that I don't like, this works for me. But maybe you might want a Peaceful Playlist for certain times, and a Seizure Inducer for other times.

The Web

The web part is entirely anonymous, mostly. Each device that uploads one or more designs is given a name like Anon_44, so that you can browse your own designs, browse Anon_23's designs, or delete a design you uploaded and no longer like, or overwrite a design that you wish to change. At the present there is no way to automatically fetch web designs. I'd like to add that, and I might, but if very many people were to use it my poor little web server would probably have issues.

Other stuff

The main menu has an Info page that may or not have any information that anyone other than me is interested in. The logs fall into that same category.