# The Dragonfly Wings

The dragonfly was a collaboration between many many people. These wings are all that remain after it was burnt at Burning ManâŠ

## Story

The dragonfly was a Burning Man project created in my backyard by Richerd Chan, Elya Le, and a dozen otherÂ volunteers.Â The wooden part burned, but the extra set of LED wings survived and came back to my house (a decoy pair of wooden wings was burned instead).

This amazing project deserves to be shared, so I decided to set the wings back up and document their recreation.

### 1. Create the wings

The wings were made with eight strands of LEDs each. The small wings each have 381 LEDs and the big wings have 481 LEDs.

Elya Le designed the lasercut pattern from the wings. The diffusion material is a flexible acrylic from Tap plastics.

### 2. Build a stand

The original dragonfly wings and body were created around steel blocks to make them sturdy enough to climb on.

But how to display the just two wings? I originally wanted the wings to stand vertically, but I realized that the amount of weight I needed for the base of the wingâs stand had to be greater than the weight of the wing itself (each wing is 30-40lbs). In the interest of making them semi-portable, I settled for cutting the original metal base so that it would hold two wings horizontal to the ground.

### 3. Make a wiring harness

The original project used eight 110 amp hour deep cycle marine batteries. Iâll be displaying this indoors, so I can just plug a power converter into the wall. This AC power supply runs off of 120 Volts AC at ~6amps, and converts it to 5volts DC at 60 amps.

How much power will my LEDs draw? When displaying pure white, each of these WS8211s draws 0.4 amps.

381 LEDs per wing times two is 762 times 0.4amps = 30.48amps at max brightness. In the code, Iâve dialed my brightness back to 70% so I only need 21.34 amps.

### 4. Test the LEDs with Processing

My next step was to test the wings to make sure they were still working.

I started fcserver on my laptop by clicking onÂ fcserver.osxÂ on Mac orÂ fcserver.exeÂ on windows.

When Fadecandy starts up, it automatically detects my Fadecandies. They show up with their serial numbers in the terminal window.

### Configure the server for Fadecandy

You can find full instructions for the Fadecandy server configurationÂ here.

Open fadecandy-package-02>examples>config an openÂ multi-device.pdeÂ in a text editor.

Past the following code. Edit the serial numbers to match the serials of your devices.

{
âlistenâ: [null, 7890],
âverboseâ: true,
âcolorâ: {
âgammaâ: 2.5,
âwhitepointâ: [0.7, 0.7, 0.7]
},
âdevicesâ: [
{
âserialâ: âLXJNACKAPTQLQVMFâ,
âmapâ: [
[ 0, 0, 0, 511 ]

]
},
{
âserialâ: âELWQLXUWZPYTKTIBâ,
âmapâ: [
[ 0, 0, 0, 511]
]
}
]
}

The âmapâ maps the wingâs LED strips to the output of the fadecandy. Each fadecandy can run 512 LEDs (8 rows of 64). Here Iâm just mapping the LEDs as if they were a long strip, from 0 to 511.

Close your terminal window that has fcserver if itâs still running.

Re-open terminal, change directory to the directory where fcserver is, and run:

./fcserver-osx multi-device.json

This will restart fcserver using your new config files.

Open Processing. Iâm using Processing 2.

Open theÂ test sketchÂ from github in processing and press ârun.â

It lights each LED strip in the wing a different color. Then I can use my computer keys âxâ and âzâ to send a flashing LED back and forth to count how many LEDs there are in each strip.

// Test file to count how many LEDs are in each strip
OPC opc;
int flashIndex = 0;
int index = 0;
int max = 512;
void setup()
{
opc = new OPC(this, â127.0.0.1â, 7890);
frameRate(5);
colorMode(RGB, 100);
for (int i = 0; i < max; i++) {
opc.setPixel(i, color(0, 0, 0));
}
opc.writePixels();
}
void draw()
{
// for (int i = 0; i < index; i++) {
// opc.setPixel(i, color(255, 0, 0));
// }
//
for (int i = 64 * 0; i < 64 * 0 + 64; i++) {
opc.setPixel(i, color(255, 0, 0));
}
for (int i = 64 * 1; i < 64 * 1 + 64; i++) {
opc.setPixel(i, color(255, 255, 0));
}
for (int i = 64 * 2; i < 64 * 2 + 64; i++) {
opc.setPixel(i, color(0, 255, 0));
}
for (int i = 64 * 3; i < 64 * 3 + 64; i++) {
opc.setPixel(i, color(0, 255, 255));
}
for (int i = 64 * 4; i < 64 * 4 + 64; i++) {
opc.setPixel(i, color(0, 0, 255));
}
for (int i = 64 * 5; i < 64 * 5 + 64; i++) {
opc.setPixel(i, color(255, 0, 255));
}
for (int i = 64 * 6; i < 64 * 6 + 64; i++) {
opc.setPixel(i, color(255, 255, 255));
}
for (int i = 64 * 7; i < 64 * 7 + 64; i++) {
opc.setPixel(i, color(128, 0, 128));
}
for (int i = 0; i < 8; i++) {
int flash = (index % 2) == 0 ? 0 : 255;
color flashColor = color(flash, flash, flash);
opc.setPixel(i * 64 + flashIndex, flashColor);
}
// When you havenât assigned any LEDs to pixels, you have to explicitly
// write them to the server. Otherwise, this happens automatically after draw().
opc.writePixels();
index++;
}
void keyPressed() {
if (key == âxâ) {
flashIndex++;
}
if (key == âzâ) {
flashIndexâ;
}
println(âindex is: â + flashIndex);
}

Now that I know how many LEDs are in each strip, Iâm able to map them in my config files. I reopenÂ multi-device.jsonÂ and remap them. Here is the updated mapping for my two fadecandies:

âdevicesâ: [
{
âserialâ: âPTINAQHBFTXOUIDPâ,
âmapâ: [
[ 0, 0, 0, 52 ],
[ 0, 52, 64, 51 ],
[ 0, 103, 128, 64 ],
[ 0, 167, 192, 64 ],
[ 0, 213, 256, 64 ],
[ 0, 295, 320, 63 ],
[ 0, 358, 384, 60 ],
[ 0, 418, 448, 63 ]
]
},
{
âserialâ: âFJEBWISCDPPWQUVNâ,
âmapâ: [
[ 0, 470, 0, 52 ],
[ 0, 521, 64, 51 ],
[ 0, 584, 128, 64 ],
[ 0, 649, 192, 64 ],
[ 0, 713, 256, 64 ],
[ 0, 776, 320, 63 ],
[ 0, 836, 384, 60 ],
[ 0, 899, 448, 63 ]
]
}
]

Thereâs aÂ reference for OPC.pdeÂ in Fadecandyâs documentation. Iâm using the following mapping objects:

[Â OPC Channel,Â First OPC Pixel,Â First output pixel,Â Pixel countÂ ]

• I only have one channel (connected to two fadecandies), so each line begins with zero.
• The first OPC pixel is the starting pixelÂ as Iâd like to address it. By default each output of the fadecandy has and index of 0 and goes to 64 pixels, but since my strips are all different lengths, I add their indexes here according to the lengths of the strip.xxzzzzzzxxxxz
• The first output pixel is the corresponding numberÂ as handled by the fadecandy board. Since it regards every strand as having 64 pixels, these numbers are 64+=.
• The pixel count is the total pixel count of each strip. In my case, theyâre all different lengths.

Iâm also indexing the second fadecandyâs first OPC pixel at 470. If I gave it a zero address, the top and bottom wings would always be synced.

If you have an irregular array of LEDs, itâs easiest to map them in config. If your LEDs are in an even grid, itâs easier to simply map the total number of LEDs in config and then address them with a OPCâs grid method. Note that for irregular displays, symmetrical patterns that look great on grids, such as the examples âgrid32x16z_ringsâ and âgrid24x8z_wavesâ look totally distorted. Trying to do text is also quite difficult.

After youâve changed your mapping, donât forget to update the config file:

./fcserver-osx multi-device.json

Try out some of the samples and see how they lookÂ with your new mapping.

You can either try an unmapped sketch, likeÂ this oneÂ or try remapping one of the fadecandy grid examples, likeÂ grid24x8z_waves. Simply replace the three 8Ă8 grids in the sketch with something like this:

opc.ledGrid(0, 64, 16, width/2, height/2, width / 70.0, 10, 0, false);

Note:

If you install command line tools, you can run a sketch from the command line like this (assuming that the the âdragonfly-wingsâ code is in a folder named Downloads):

### 5. Raspberry Pi setup

Iâm using a Raspberry Pi (instead of my laptop) in the actual installation.

Install Processing

You always want to make sure your Pi is up to date. Open terminal and type:

sudo apt-get -y update

The â-yâ stands for yes, so this breezes through those pesky âtype yesâ prompts that youâd always type yes to anyway. Needless to say, donât use it if youâre not sure that youâre sure you want to answer yes.

Retrieve the Fadecandy software from Github:

The package includes a pre-built executable for Raspberry Pi, but itâs built on an older version of Raspbian and wonât work on the current system. Not to worry, a new one can be compiled in just a few steps:

This takes about 10 minutes to complete. Once itâs finished, type:

sudo mv fcserver /usr/local/bin

Then create a new configuration file:

sudo nano /usr/local/bin/fcserver.json

Weâre going to copy and paste the config file that weâve previously created on our laptop here, with the updated mapping.

Connect each of your fadecandies to the rasbperry piâs USB ports. Run in terminal:

sudo fcserver

I had some trouble running this, but found that it worked after rebooting

sudo reboot

Once fcserver is running, try some of the example processing sketches that looked good, E.G.:

processing grid32x16z_wavefronts.pde