# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Introduction

https://youtu.be/ZgeYBFm5DqE

### Imagine..

All your LED costume pieces in sync with each other.&nbsp; All of them listening and responding to the music around you.&nbsp; Your hand-made hat, wig, poi, and jacket all pulsing to the sound and visuals running on your laptop -- with no extra coding required.

Magic.

This guide uses the code and concepts from the&nbsp;[Lightship LED guide](../../../../lightship-led-animation-over-wifi/overview) and integrates it into a costume piece, so you can roam around your dance club, playa party or DJ gig and let the visuals follow you wherever you go.

This is a pretty intense guide -- getting everything set up will take a bit of doing, but once you're done, all you have to do is press play -- and the LEDs will reflect whatever's happening on your computer screen.

I'll say that again: whatever is on your screen, is also playing on your costume.&nbsp; The mind boggles.

These same concepts can easily be applied to top hats, poi, LED coats, or whatever other project you've got on your workbench.&nbsp; The Feather M0 and Dotstar LEDs make it all possible.

### Adafruit Parts

- Feather M0 Wifi
- Tactile on/off switch
- Lithium Ion battery
- about 2 m of 30 LED/meter Dotstars
- 26awg Silicone wire in various colors

### Other Bits Needed

- A wig (I like&nbsp;[Arda Wigs](http://arda-wigs.com/) best but any wig will work)
- [Wig clips](http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=wig+clips&rh=i%3Aaps%2Ck%3Awig+clips)
- [Large tubular crin ribbon](http://www.amazon.com/gp/product/B003JV32NO?psc=1&redirect=true&ref_=oh_aui_detailpage_o04_s00)&nbsp;-- be sure you get the large size, the smaller won't fit the LED strips.&nbsp;
- 1/2" clear [heat shrink tubing](http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=1%2F2%22+clear+heat+shrink)
- Cable ties

### Tools

- Hot glue gun
- Heat gun
- Soldering Iron & accessories
- Needle & thread

![](https://cdn-learn.adafruit.com/assets/assets/000/031/477/medium800/led_strips_3wifiwig_tilt.jpg?1459470925)

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Setup & Testing

This is a fairly complex project with lots of steps. &nbsp;Each step is a fantastic opportunity for stuff to go wrong, so it's really important to stop at every step and test to make sure the piece you're working on is working for you.

There are two major parts to this guide: &nbsp;the software and&nbsp;computer-ish part and the hardware, soldering &&nbsp;building part. &nbsp;It's a great idea to get your software up and running 100% before starting on the fairly complex hardware build for this project, and for that you'll need to set up a testing strip.

Dotstar strips come with a connector pre-soldered onto the ends. &nbsp;For testing purposes I like to just&nbsp;cut the connector head off and use the pre-soldered wires to connect directly to my project.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/031/569/medium800/led_strips_cut_connetor.jpg?1459872305)

Solder your strand of Dotstars:

- Dotstar Clock --\> Feather 11
- Dotstar Data --\> Feather 13
- Dotstar G --\> Feather G
- Dotstar + --\> Feather 3v

![](https://cdn-learn.adafruit.com/assets/assets/000/031/570/medium800/led_strips_test_strip.jpg?1459872315)

Find&nbsp;the Adafruit DotStar Strandtest code. &nbsp;You'll find this in the Adafruit Dotstar library for Arduino. Use the Library Manager to install this (Sketch→Include Library→Manage Libraries…), or if you’re using an older version of the Arduino IDE, it can be downloaded and [installed manually](../../../../adafruit-all-about-arduino-libraries-install-use/arduino-libraries):

[Adafruit_Dotstar Library](https://github.com/adafruit/Adafruit_DotStar/archive/master.zip)
If you've used Feather M0 before, upload the Dotstar code and test to be sure the lights come on.

If you haven't used Feather before…intermission time! Read&nbsp;our Feather M0 Basic Proto guide to set this up:

## **[Adafruit Feather M0 Basic Proto — Arduino IDE Setup](../../../../adafruit-feather-m0-basic-proto/setup)**

Newer versions of the Arduino IDE have been released since that guide…1.6.5 and 1.6.7 both seem to work pretty well with the M0 board.

Even if you _have_ used the Feather M0 before, use the Arduino IDE Boards Manager to check that you’re using the latest _Adafruit SAMD Boards_ support files. (For the Arduino Zero, install the _Arduino SAMD Boards_ package.)

**Before continuing, make sure you can compile and upload sketches to the board. Try the basic “Blink” example as a test.**

Once you have "Blink" working, upload the Dotstar Strandtest code and be sure your LEDs light up.

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Software

For WiFi support and for our code to use certain M0-specific features, download and install the&nbsp;**[Adafruit\_WINC1500](https://github.com/adafruit/Adafruit_WINC1500)**&nbsp;library (for Feather M0 WiFi) or **WiFi101** (for Arduino Zero w/WiFi Shield 101 — install via Arduino Library manager), plus the**&nbsp;[Adafruit Arduino Zero ASF Core Library](https://github.com/adafruit/Adafruit_ASFcore)**&nbsp;and **[Adafruit\_ZeroDMA:](https://github.com/adafruit/Adafruit_ZeroDMA)**

[Download Adafruit_WINC1500 library from Github](https://github.com/adafruit/Adafruit_WINC1500/archive/master.zip)
[Download ASF Core Library from Github](https://github.com/adafruit/Adafruit_ASFcore/archive/master.zip)
[Download Adafruit_ZeroDMA library for Github](https://github.com/adafruit/Adafruit_ZeroDMA/archive/master.zip)
Library installation is a frequent stumbling block…if you need assistance, our&nbsp;[All About Arduino Libraries](../../../../adafruit-all-about-arduino-libraries-install-use)&nbsp;guide spells it out in detail!

Then download and extract the ZIP file containing&nbsp;the code for this project:

[Download Adafruit_Lightship from Github](https://github.com/adafruit/Adafruit_Lightship/archive/master.zip)
In this archive are two folders:

The first, “ **Arduino** ,” contains the OPCserver sketch for the Feather board (or Arduino Zero).

The second, “ **Processing** ,” contains several Open Pixel Control client demos for use with the _Processing_&nbsp;programming language. These will run on your main&nbsp;computer (desktop or laptop).

The client/server nomenclature may seem odd…the OPC “server” runs on the tiny Feather board, while OPC “clients” are programs running on a larger and more capable system. All the color and animation decisions are made in the client applications…the server just passes these through to the LEDs.

OPC clients can be written in many programming languages, but we’ll use _ **Processing** _ (a derivative of Java) as it’s free, cross-platform&nbsp;(runs on Windows, Mac and Linux) and is focused on visual arts.

## **[Processing Downloads Page](https://processing.org/download/?processing)**

For now, we recommend downloading the **version 2.2.1 release** of Processing for your operating system. The 3.X series introduced some significant changes that aren’t always compatible with existing Processing code.

Processing looks a _lot_ like the Arduino IDE (in fact, the Arduino IDE derived from the same code base). This can be confusing because Arduino sketches&nbsp;don’t work in Processing, nor vice versa. Make sure you’re loading sketches&nbsp;into the correct IDE for each.

# Edit Arduino Sketch

In the Arduino IDE, open the “OPCserver” sketch. We’ll make some changes before uploading to the board, to configure for your particular hardware and network.

Toward the top of the code, the following lines are of interest. They’re not&nbsp;in one place, but all appear&nbsp;in the first 50 or so lines of the sketch:

```
#define ADAFRUIT_ATWINC
```

This tells the code to use the Adafruit\_ATWINC library. If using an Arduino Zero w/WiFi Shield 101 and Native USB comment this line out.

```
//#define Serial SerialUSB // Enable if using Arduino Zero 'Native USB' port
```

Commented out by default. Enable this line only if you’re using an Arduino Zero _and_ are connected to the “Native USB” port (rather than the “Programming” port).

```
#define IP_TYPE IP_STATIC // IP_STATIC | IP_DYNAMIC | IP_BONJOUR
```

You’ll probably leave this line as-is, which tells the WiFi module to use a static IP address (rather than dynamically assigning an address from your WiFi router). A static address makes it easier for OPC clients to access the device, as it’s always in a known location.

**This requires some knowledge of&nbsp;how your WiFi router doles out IP addresses.** Most will have a numeric range of IP addresses to assign dynamically…for example, my WiFi router starts issuing dynamic IP addresses at 192.168.0.100 and above. I can assign fixed addresses below that (except for 0 and 1) to specific devices, as long as others aren’t using them.

```
char      *ssid = "NETWORK_NAME",   // WiFi credentials
          *pass = "NETWORK_PASSWORD";
```

Replace these two strings with&nbsp;the login credentials for your wireless network.

```
IPAddress  ipaddr(192, 168, 0, 60); // Static IP address, if so configured
```

This is the static IP address to be assigned to the device on your wireless network. As mentioned above, this requires knowledge of your router’s DHCP policy. Most will start with 192.168.0.X, 192.168.1.X, 10.0.0.X or 10.1.1.X — but not all.

Whatever address you use, you’ll need this later for the Processing sketches.

A little further down in the code (around line 100) are these lines:

```
#define DOTSTAR_BLUEBYTE  0
#define DOTSTAR_GREENBYTE 1
#define DOTSTAR_REDBYTE   2
```

You probably don't need to edit these. But later, if you find the test examples are producing the wrong colors, you may need to return here and edit these numbers. This is the “native color order” used by the DotStar LEDs…it’s changed at least once in different production runs of these devices. If your LEDs are from a different batch, you’ll need to swap or rearrange some of these numbers (they’ll always be the values 0, 1 and 2, only the order&nbsp;changes).

# Upload

Make sure **Adafruit Feather M0** (or **Arduino Zero** if using that board) is selected in the Tools→Board, then upload the code to the board.

If the code **doesn’t compile** (throws an error):

- Confirm the right board type and USB port are selected in the Tools menu. Have you installed the correct files for this board using the Boards Manager?
- Confirm the correct libraries are installed: **Adafruit\_ASFcore** , **Adafruit\_ZeroDMA** and **Adafruit\_WINC1500** (for Feather M0) or **WiFi101** (for Arduino Zero + WiFi Shield 101).
- There may be problems if _both_ the WiFi101 and Adafruit\_WINC1500 libraries are installed. If so, remove the WiFi101 library…the WiFi Shield 101 works fine with the WINC1500 library, you’ll just need to edit some pin numbers (this is commented in the code).
- Check that you haven’t mangled the syntax on any of the lines edited above. For example…the IP address has commas (not periods) between each value.

If the code **compiles but doesn’t upload** :

- If you built the circuit with the DPDT switch, this needs to be in the “RUN”&nbsp;position to upload code.
- Try uploading again. Or tap reset once or twice on the board, then upload. The M0 boards are a new thing and can be a bit persnickety what with all the different operating systems and USB port types.

 **Now open the Arduino IDE Serial Monitor.**

If you see nothing at all, that’s actually a good sign. Or if you see a “Server listening” message, that’s good too.

If you get an unending series of periods (...), the board isn’t connecting to your wireless network. Confirm that the network name, password and provided IP address are all valid.

If everything checks out, let’s try the examples…

![](https://cdn-learn.adafruit.com/assets/assets/000/031/472/medium800/led_strips_2wifiwig_relax.jpg?1459370972)

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## OPC Strandtest

Hello world! Launch the Processing (2.2.1) IDE and load the first of our example programs: **OPCstrandtest.**

At the top of the code&nbsp;are&nbsp;these two lines:

```
OPC opc       = new OPC(this, "192.168.0.60", 7890);
int numPixels = 256; // Set this to actual strand length
```

The first line holds the address of your&nbsp;OPC server device. We previously configured that in the Arduino code. The format here is just a little different though…instead of four comma-delimited values (192, 168, 0, 60), here it’s a string with period separators "192.168.0.60". Edit the numbers to match the Arduino sketch.

Next line is the number of LEDs in your DotStar chain. This might be 64 for an 8x8 matrix, or 60 (or 144, etc.) for one meter of DotStar strip.

When you run this code (the top-left icon in the Processing window), after just a moment’s delay you should see the message “Connected to OPC server” and get a “chaser” down the DotStar chain that cycles between red, green and blue for each pass. Press the ESC key to stop the program.

If the colors appear in the wrong order (not red, green, blue), you’ll need to edit the Arduino sketch to match your particular DotStar hardware. This is explained near&nbsp;the bottom of the “Software”&nbsp;page.

If it runs slowly or stutters, especially with long LED runs, you may need to reduce the frame rate. Inside the setup() function you’ll see a call to frameRate(). It takes a single argument, the number of frames per second. The default (if not specified) is 60 frames per second…that’s usually fine with small projects, but with lots of LEDs you may need to dial it back, to perhaps 30 frames per second.

If you don’t see the “Connected” message and don’t get any LEDs: either the Server sketch on the Arduino can’t connect to the wireless network, or the address at the top of the Processing sketch is incorrect.

**Do not continue until you have the led “chaser” working, and it’s cycling from red to green to blue.**

![](https://cdn-learn.adafruit.com/assets/assets/000/031/471/medium800/led_strips_4wifiwig_smile.jpg?1459370933)

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Wiring

![](https://cdn-learn.adafruit.com/assets/assets/000/031/392/medium800/led_strips_wifi_wig2.jpg?1458756398)

This wig has 6 Dotstar strips.&nbsp; Each strip's power and ground wires are wired in parallel (starfish pattern, or lots of little "spokes") and the Clock and Data wires are wired in sequence (serpentine pattern, or one long wire from start to finish).

This means that if one of your clock or data lines comes un-soldered, everything "downstream" of that bad solder joint will stop working.&nbsp; So be sure your soldering and gluing is rock-solid for this project!

- Dotstar Clock --\> Feather 11
- Dotstar Data --\> Feather 13
- Dotstar G --\> Feather G
- Dotstar + --\> Feather 3v

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## LED Strip Wiring

![](https://cdn-learn.adafruit.com/assets/assets/000/031/394/medium800/led_strips_IMG_5593.jpg?1458757293)

### Prepare LED Strips

Cut 6 strands of dotstars -- 3 for each side.&nbsp; My strips have 8, 10, and 12 pixels respectively since I like a "layered" look on the finished wig.&nbsp; Cut carefully between the copper pads and leave the silicone sleeve intact.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/395/medium800/led_strips_IMG_5597.jpg?1458757405)

### Clock & Data Out

Start by finding the "out" ends of all the strands and line them up so they're all correctly faced.&nbsp; Solder a long (15-20") clock and data wire onto the pins at this end of 5 of the strips (you don't need clock-out or data-out on the last strip).

![](https://cdn-learn.adafruit.com/assets/assets/000/031/396/medium800/led_strips_IMG_5599.jpg?1458757478)

Slide the strips out of their silicone housing, then slide them back in, with the wires trailing along the back of the strip.&nbsp; The idea here is to get the wires to feed neatly back through the silicone strip so they won't ever get tugged or bumped.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/031/398/medium800/led_strips_wires_connected.jpg?1458758289)

### Clock & Data In

Once you've got the sleeves back on, expose the "in" end of the strip.&nbsp;

On strip #1, solder a long clock wire and data wire to the "in" pads.&nbsp; These will later connect to the Feather.

Turn this strip over and find the wires poking out the back of its silicone sleeve.&nbsp; Trim to a good length and then solder these "out" wires from strip #1 to the "in" pads on strip #2.

Find strip #2's "out" wires and solder those to the "in" pads on strip #3.&nbsp; You now have a daisy chain of 3 LED strips all connected to each other.

Repeat this sequence with the other 3 strips.&nbsp; **Note: Do not daisy-chain all 6 strips together at this point!** &nbsp; That will make it impossible to thread the wires into the wig for attachment.&nbsp; We'll connect the clock and data lines from strip #3 to strip #4 together later.

For now, take a sharpie and mark the "out" clock and data wires on strip #3 and the "in" wires on strip #4, so you'll know which is which later on.

### Power & Ground Wires

Cut 6 short (3") red and black wires and solder onto the + and - pads of each strip.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/399/medium800/led_strips_IMG_5604.jpg?1458758316)

Cut a 6" power wire and twist it together with the power wire from strip #1.&nbsp; Then, twist together the power wires from strips #2 and #3.&nbsp; Splice all these wires together and cover with heat shrink.&nbsp; You should end up with one red wire that splits 3 ways and connects to each strip.

Repeat with the ground wires, and do the same for strips #4, 5 and 6.

At this point you'll want to **test all your connections** and make sure everything is solid and all the strips work.&nbsp; Hook each set of 3 strips up to a gemma or flora running the Dotstar Strandtest code and be really sure everything works perfectly.&nbsp; In the next step we'll be coating these connections in glue and heat shrink and they'll be very hard to fix!&nbsp; So be sure everything works before proceeding.

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Wig Assembly

Get out your heat gun and plug in your hot glue gun.&nbsp; You'll need both tools ready in order to create a good, solid, rugged seal that will enforce your wiring and keep the strands safe.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/401/medium800/led_strips_IMG_5608.jpg?1458759081)

Cut a piece of clear 1/2" heat shrink and slip it over the bottom of each strand.&nbsp; Before you shrink it down, pump some hot glue in -- just enough to cover the connections and fill the end of the silicone sleeve.

Hit it with your heat gun to shrink down the heat shrink, before the glue cools fully.&nbsp; If the glue squishes out all over the place, you've done it right.&nbsp; Let it cool completely and then trim off any excess glue.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/402/medium800/led_strips_wiring_pic.jpg?1458759260)

Do the same for the top of each strip (you'll need to slide the heat shrink on from the bottom).

Give your wires some gentle tugs.&nbsp; You'll be supporting the weight of each strand on the wires, so be really sure each one is secure and solid.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/403/medium800/led_strips_IMG_5621.jpg?1458759365)

Measure out your tubular crin and cut it to the length you want.&nbsp;&nbsp;

Slide one piece of crin over each LED strip and secure it with a cable tie.&nbsp; Then, using more ribbon or cable ties, secure each set of 3 strips sturdily together.&nbsp; Add in any leftover crin ribbon to create a filled-out cyber-dred.

Turn the ends of all the crin pieces inside out so they don't unravel.

![led_strips_IMG_5626.jpg](https://cdn-learn.adafruit.com/assets/assets/000/031/406/medium640/led_strips_IMG_5626.jpg?1458759661)

![led_strips_IMG_5627.jpg](https://cdn-learn.adafruit.com/assets/assets/000/031/407/medium640/led_strips_IMG_5627.jpg?1458759690)

![led_strips_IMG_5628.jpg](https://cdn-learn.adafruit.com/assets/assets/000/031/408/medium640/led_strips_IMG_5628.jpg?1458759716)

![](https://cdn-learn.adafruit.com/assets/assets/000/031/409/medium800/led_strips_IMG_5642.jpg?1458759759)

Insert all the wires from each cyber-dred through the cap of your wig.&nbsp; One dred will have 6 wires and the other will have 4. Make sure you're happy with the placement, and add a whole bunch more zip ties to keep the dreds in place.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/410/medium800/led_strips_IMG_5647.jpg?1458759852)

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Final Wiring

![](https://cdn-learn.adafruit.com/assets/assets/000/031/411/medium800/led_strips_IMG_5649.jpg?1458760020)

### Power Connector

Plug your male JST connector into the female plug coming from your battery and take careful note of which side is power and which is ground.

Slide a small piece of heat shrink onto one of the power and one of the ground wires you just attached to your LED strand.&nbsp; Carefully solder each of these wires onto the JST connector and cover with the heat shrink.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/412/medium800/led_strips_IMG_5652.jpg?1458760060)

Now we're going to add hardcore strain relief to this connector.&nbsp; It's the piece that takes the most tugging and wear and tear, so we want to be sure it won't break while you're changing batteries (in the dark, in the middle of the night, most likely).

Slide a large 1/2" or 3/8" piece of heat shrink over the connector, leaving the front open but covering the back and the connections you just made completely.&nbsp; Don't heat it yet!

![](https://cdn-learn.adafruit.com/assets/assets/000/031/413/medium800/led_strips_IMG_5653.jpg?1458760080)

Take a hot glue gun and fill the back side of the heat shrink with hot glue.&nbsp; Then, while your glue is still liquid, hit the whole assembly with a heat gun to shrink the heat shrink in a controlled manner.&nbsp; Be careful not to get glue inside the connector itself.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/414/medium800/led_strips_wiring_switchadded.jpg?1458760230)

Solder your on/off switch inline with the red wire coming from your power connector.

Then, create your power harness:&nbsp; Twist together the red wires from each cyber-dred.&nbsp; Twist another red wire to the one coming from your power switch.&nbsp; Connect all 4 of these wires together and cover with heat shrink.

Repeat with the ground wires.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/415/medium800/led_strips_IMG_5658.jpg?1458760423)

Connect the "out" wires from strip #3 to the "in" wires for strip #4.&nbsp; Aren't you glad you marked these earlier?

Now you have one free power wire, one ground wire, one data wire and one clock wire.&nbsp; Connect these to your Feather as shown.&nbsp; Clock goes to 11 and data goes to 13.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/416/medium800/led_strips_IMG_5661.jpg?1458760554)

Gently set your wig down or place it on a wig head and plug a battery in.&nbsp; Make sure your feather powers up!&nbsp; It's time for a test run.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/031/417/medium800/led_strips_IMG_5666.jpg?1458760619)

First, upload the dotstar Strandtest code to your Feather.&nbsp; All 6 strands should light up in sequence.&nbsp; Be sure you can run Strandtest before proceeding any further.

Next, upload the **OPCserver** code to your Feather in the Arduino environment, making sure you've edited the sketch with your local wifi network IP address and password.&nbsp;

Launch Processing and open the **OPCstrandtest** code. Edit these lines to reflect your IP address and strand length.

```
OPC opc       = new OPC(this, "192.168.0.101", 7890);  //your IP adress here
int numPixels = 60; // Set this to actual strand length
```

Press "play".&nbsp; If all goes according to plan, you'll see the strandtest code run on your wig.&nbsp; Congratulations!&nbsp; Let's secure the components and then it's time for the fun stuff.

If your strandtest code doesn't run, don't despair.&nbsp; This is pretty complicated.&nbsp; Some things to check:

- Is your wig powered up with a battery and the switch turned on?&nbsp;
- Are your IP address and password correct in the OPCserver Arduino sketch?
- Is the IP address correct in the OPCstrandtest Processing sketch?
- Is your computer on the same Wifi network as the OPCserver sketch?
- Are all the requisite libraries installed?

More troubleshooting tips over at [Phil Burgess' Lightship guide.](../../../../lightship-led-animation-over-wifi/overview)

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Finishing

![](https://cdn-learn.adafruit.com/assets/assets/000/031/418/medium800/led_strips_IMG_5672.jpg?1458761692)

Sew your Feather to your wig using the mounting holes.&nbsp; It works well to sandwich any extra wires behind the feather, but be sure your USB port is accessible.

Add a battery pocket made from a scrap of fabric or netting.&nbsp;

Sew wig clips into the front and sides of the wig.&nbsp; The added weight of the electronics and dreds may make it slide off your head otherwise.&nbsp; Wig clips are beautiful things.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/419/medium800/led_strips_IMG_5673.jpg?1458761717)

Since I dance pretty hard in my wig, I also added a little scrap of oilcloth over the Feather, so it's not in any danger of shorting out if I sweat or wear the wig with damp hair.

![](https://cdn-learn.adafruit.com/assets/assets/000/031/420/medium800/led_strips_IMG_5676.jpg?1458761789)

Finish up by adding some ribbons or flowers or whatever your imagination desires to hide the zip ties at the top.

# Pixie CyberWig - A Wearable WiFi LED Visualization 

## Use It

![](https://cdn-learn.adafruit.com/assets/assets/000/031/470/medium800/led_strips_1wifiwig_purple.jpg?1459370912)

The OPC folder has 4 files in it.&nbsp; One is OPCstrandtest, which you are already familiar with.

Check out Phil's&nbsp;[Lightship guide](../../../../lightship-led-animation-over-wifi/opc-client-apps) for descriptions of how to use OPCpianoroll and OPCvideo.

New to this guide is the OPCscreencap sketch.&nbsp; This sketch will capture whatever is playing on your screen in realtime and send it out to your wig over wifi.&nbsp;

Open OPCscreencap and update the code to reflect your device's IP address.&nbsp; Also, change the arrayWidth and arrayHeight numbers to match your LED strands -- I used 6 for width since we have 6 strands, and 12 for height since my longest strip is 12 pixels long.

&nbsp;

```
OPC opc       = new OPC(this, "192.168.0.101", 7890);
int arrayWidth  = 6,   //change these numbers to reflect your LED strands
    arrayHeight = 12,
    pixelSize   = 30,
    numPixels   = arrayWidth * arrayHeight,
    screenNum   = 0  ;  //if you have multiple computer monitors, try changing this to 1
```

&nbsp;

Press "Play" in Processing.&nbsp; You'll see a pixelated version of your screen that's 6x12.&nbsp; Move some windows around on your screen and see if the lights in the wig change along with you.

To see the power of this app, pull up a music visualizer program (iTunes has a good native one, or head over to&nbsp;[Electric Sheep](https://www.youtube.com/watch?v=O5RdMvgk8b0) on YouTube).&nbsp;&nbsp; Make the video full screen while your Processing script is running, and Be Amazed.

https://www.youtube.com/watch?v=INhR7EsNCUg


## Featured Products

### Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500

[Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500](https://www.adafruit.com/product/3010)
Feather is the new development board from Adafruit, and like its namesake it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores. This is the&nbsp; **Adafruit Feather M0 WiFi&nbsp;w/ATWINC1500** - our take on an...

In Stock
[Buy Now](https://www.adafruit.com/product/3010)
[Related Guides to the Product](https://learn.adafruit.com/products/3010/guides)
### Tactile On/Off Switch with Leads

[Tactile On/Off Switch with Leads](https://www.adafruit.com/product/1092)
Squeeze once to turn on, squeeze again to turn off! This clicky switch makes a great power switch or mode toggler. We like this switch because it's easy to embed in a seam for easily powering up/off wearable and fabric projects. Can handle up to 14V and 2 Amps! This is a really satisfying...

In Stock
[Buy Now](https://www.adafruit.com/product/1092)
[Related Guides to the Product](https://learn.adafruit.com/products/1092/guides)
### Lithium Ion Battery - 3.7V 2000mAh

[Lithium Ion Battery - 3.7V 2000mAh](https://www.adafruit.com/product/2011)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 2000mAh. If you need a larger (or smaller!) battery,&nbsp;<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/2011)
[Related Guides to the Product](https://learn.adafruit.com/products/2011/guides)
### Adafruit DotStar Digital LED Strip - White 30 LED - Per Meter 5m

[Adafruit DotStar Digital LED Strip - White 30 LED - Per Meter 5m](https://www.adafruit.com/product/2238)
Move over NeoPixels, there's a new LED strip in town! These fancy new DotStar LED strips are a great upgrade for people who have loved and used NeoPixel strips for a few years but want something even better. DotStar LEDs use generic 2-wire SPI, so you can push data much faster than with...

In Stock
[Buy Now](https://www.adafruit.com/product/2238)
[Related Guides to the Product](https://learn.adafruit.com/products/2238/guides)
### Silicone Cover Stranded-Core Wire - 2m 26AWG Red

[Silicone Cover Stranded-Core Wire - 2m 26AWG Red](https://www.adafruit.com/product/1877)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1877)
[Related Guides to the Product](https://learn.adafruit.com/products/1877/guides)

## Related Guides

- [7 Segment Display Internet Clock](https://learn.adafruit.com/7-segment-display-internet-clock.md)
- [3D Printed Case for Adafruit Feather](https://learn.adafruit.com/3d-printed-case-for-adafruit-feather.md)
- [Internet of Things Infrared Remote](https://learn.adafruit.com/internet-of-things-infrared-remote.md)
- [MicroPython Displays: Drawing Text](https://learn.adafruit.com/micropython-displays-drawing-text.md)
- [CircuitPython Hardware: LED Backpacks & FeatherWings](https://learn.adafruit.com/micropython-hardware-led-backpacks-and-featherwings.md)
- [Proper Debugging of ATSAMD21 Processors](https://learn.adafruit.com/proper-step-debugging-atsamd21-arduino-zero-m0.md)
- [Introducing Adafruit Feather](https://learn.adafruit.com/adafruit-feather.md)
- [Automatic Twitch On-Air Sign](https://learn.adafruit.com/automatic-twitch-on-air-sign.md)
- [Adafruit DotStar LEDs](https://learn.adafruit.com/adafruit-dotstar-leds.md)
- [Debugging the SAMD21 with GDB](https://learn.adafruit.com/debugging-the-samd21-with-gdb.md)
- [CircuitPython Hardware: PCA9685 DC Motor & Stepper Driver](https://learn.adafruit.com/micropython-hardware-pca9685-dc-motor-and-stepper-driver.md)
- [Adafruit Class Library for Windows IoT Core](https://learn.adafruit.com/adafruit-class-library-for-windows-iot-core.md)
- [MicroPython for SAMD21](https://learn.adafruit.com/micropython-for-samd21.md)
- [Adafruit Feather M0 WiFi with ATWINC1500](https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500.md)
- [CircuitPython Hardware: ILI9341 TFT & FeatherWing](https://learn.adafruit.com/micropython-hardware-ili9341-tft-and-featherwing.md)
