LED Ampli-Tie. Created by Becky Stern. Last updated on :02:03 PM EDT

Similar documents
3D Printed LED Microphone Flag

Light-Up Angler Fish Embroidery

Getting Started with FLORA

Adafruit TPL5110 Power Timer Breakout

Celebration Spectacles

LED Stego Flex Spike Hoodie

Adafruit TPL5111 Reset Enable Timer Breakout

Getting Started with FLORA

Sewable NeoPixels. Created by Becky Stern. Last updated on :50:14 PM EDT

NeoPixel LED Cortana Costume

FLORA Pixel Brooch. Created by Becky Stern. Last updated on :19:07 PM EST

NeoPixel Basketball Hoop

3D Printed Camera LED Ring

Flora Brake Light Backpack

NeoPixel Punk Collar. Created by Becky Stern. Last updated on :41:18 PM UTC

Interior Purse Light. Created by Becky Stern. Last updated on :41:08 PM UTC

Adafruit LED Sequins. Created by Becky Stern. Last updated on :00:06 PM EST

FLORA TV-B-Gone. Created by Becky Stern. Last updated on :32:57 PM UTC

Sparkle Skirt. Created by Becky Stern. Last updated on :48:58 PM UTC

Jewel Hair Stick. Created by Leslie Birch. Last updated on :47:17 PM UTC

Magical Mistletoe. Created by Leslie Birch. Last updated on :45:29 PM UTC

Chirping Plush Owl Toy

Adafruit LED Sequins. Created by Becky Stern. Last updated on :02:00 AM UTC

NeoPixel Ring Bangle Bracelet

Cyberpunk Spikes. Created by Becky Stern. Last updated on :07:06 PM UTC

Bunny Ears with MakeCode

Guardian Shield+ Zelda Breath of the Wild

Lie Ren's Stormflower Gun Blade

Adafruit Capacitive Touch Sensor Breakouts

Trinket NeoPixel LED Longboard

Adafruit APDS9960 breakout

Circuit Playground Digital Input

Mystical LED Halloween Hood

Monochrome OLED Breakouts

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Feather Weather Lamp. Created by Ruiz Brothers. Last updated on :54:26 PM UTC

GPS Logging Dog Harness

MCP Bit DAC Tutorial

MCP Bit DAC Tutorial

Adafruit 8x16 LED Matrix FeatherWing

Crystal Glow Knuckles

Adafruit Color Sensors

TSL2561 Luminosity Sensor

MiniPOV4 - DIY Full-Color Persistence of Vision & Light-Painting Kit

Solar Boost Bag. Created by Becky Stern. Last updated on :44:55 PM UTC

NeoMatrix 8x8 Word Clock

TRON Bag. Created by Becky Stern

Coffee Detonator: The TNT Plunger Grinder

Adafruit 1.27" and 1.5" Color OLED Breakout Board

1.8" TFT Display Breakout and Shield

Adafruit MMA8451 Accelerometer Breakout

Adafruit Mini TFT " 160x80

Adafruit Si5351 Clock Generator Breakout

Simple LED Unicorn Horn

Getting Started with FLORA

Portable Apple Watch Charger

GPS Dog Collar. Created by Becky Stern. Last updated on :30:40 PM UTC

Adafruit AS channel Visible Light Sensor

Clockwork Goggles. Created by John Park. Last updated on :03:10 PM UTC

ISS Pin. Created by Leslie Birch. Last updated on :27:30 PM UTC

Camera LED Ring Light

Naughty or Nice Machine

Neon LED Signs. Created by John Park. Last updated on :11:09 PM UTC

Unicorn Hat with Moving Ears

Trinket-Powered Conference Room Occupancy Display

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

Bandolier of Light. Created by Becky Stern. Last updated on :16:17 PM EST

0.96" mini Color OLED

Cup o' Sound. Created by Becky Stern. Last updated on :30:06 PM EST

Adafruit I2C FRAM Breakout

Phone-Activated Talking Dog Collar

Bike Wheel POV Display

Adafruit Si7021 Temperature + Humidity Sensor

Alohamora Bottle. Created by Erin St Blaine. Last updated on :58:53 PM UTC

Adafruit DRV2605 Haptic Controller Breakout

Adabot Operation Game

i2c/spi LCD Backpack Created by lady ada Last updated on :11:04 PM UTC

Tent Lantern. Created by Timothy Reese. Last updated on :17:25 AM UTC

Infinity Mirror Valentine's Candy Box

Mad Science Test Tube Rack

Toy Car Speed Timer. Created by Kirby Griese. Last updated on :13:49 PM UTC

LED Eye Prosthetic. Created by Tully Jagoe. Last updated on :00:17 AM EST

Adafruit CCS811 Air Quality Sensor

Adafruit DRV2605 Haptic Controller Breakout

Glowing Star Chuck Taylor Sneakers

Adafruit PowerBoost 500 Shield

Punk LED Collar. Created by Becky Stern. Last updated on :02:45 PM EST

Audio Prank Gift Box. Created by Becky Stern. Last updated on :46:15 PM UTC

FLORA and GEMMA ICSP. Created by Becky Stern. Last updated on :42:16 PM UTC

Trellis 3D Printed Enclosure

Adafruit AMG8833 8x8 Thermal Camera Sensor

Adafruit HUZZAH32 - ESP32 Feather

Con Badge with Circuit Playground Express

3D Printed Daft Punk Helmet with Bluetooth

Adafruit IO Basics: Digital Output

RGB LCD Shield. Created by lady ada. Last updated on :48:40 PM UTC

Arduino Lesson 6. Digital Inputs

NeoPixel Manicure. Created by Sophy Wong. Last updated on :50:38 PM UTC

NeoPixie Dust Bag with Circuit Playground Express

FLORA and GEMMA ICSP. Created by Becky Stern. Last updated on :30:55 PM EST

Transcription:

LED Ampli-Tie Created by Becky Stern Last updated on 2015-08-29 03:02:03 PM EDT

Guide Contents Guide Contents Overview Tools & Supplies Circuit Diagram Battery Pouch & Flora Sewing Pixels Add Microphone The Code Wear it! 2 3 5 10 13 16 20 24 33 Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 2 of 33

Overview Make your necktie light up like a VU meter! This Flora project uses the Electret Microphone Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 3 of 33

Amplifier to trigger 16 Flora NeoPixels sewn with conductive thread along the length of the tie. Before you begin this project, we recommend reading the following guides: Getting Started with FLORA (http://adafru.it/asz) Adafruit Microphone Amplifier Breakout (http://adafru.it/azs) Conductive Thread (http://adafru.it/avx) Photo by johngineer. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 4 of 33

Tools & Supplies Bill of materials: 16 Flora NeoPixels (http://adafru.it/1260) Flora main board (http://adafru.it/659) Microphone amplifier breakout (http://adafru.it/1063) Lipoly battery (http://adafru.it/258) Scrap fabric for battery pouch 3-ply conductive thread (http://adafru.it/641) Standard cotton/poly thread Ribbon cable or conductive thread ribbon (http://adafru.it/1139) Break-away or otherwise clip-on tie (http://adafru.it/azt) You'll use a needle (http://adafru.it/615) and to stitch up the circuit. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 5 of 33

Sharp scissors are a must! You'll also need a long ruler, some tailor's chalk, and a seam ripper. Don't forget your wire strippers (http://adafru.it/527), pliers (http://adafru.it/146), and flush snips (http://adafru.it/152)! Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 6 of 33

Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 7 of 33

You will need a good quality basic multimeter that can measure voltage and continuity. Click here to buy a basic multimeter. (http://adafru.it/71) Click here to buy a top of the line multimeter. (http://adafru.it/308) Click here to buy a pocket multimeter. (http://adafru.it/850) Don't forget to learn how to use your multimeter too! (http://adafru.it/aoy) Any entry level 'all-in-one' soldering iron that you might find at your local hardware store should work. As with most things in life, you get what you pay for. Upgrading to a higher end soldering iron setup, like the Hakko FX-888 that we stock in our store (http://adafru.it/180), will make soldering fun and easy. Do not use a "ColdHeat" soldering iron! They are not suitable for delicate electronics work and can damage the Flora (see here (http://adafru.it/aoo)). Click here to buy our entry level adjustable 30W 110V soldering iron. (http://adafru.it/180) Click here to upgrade to a Genuine Hakko FX-888 adjustable temperature soldering iron. (http://adafru.it/303) Learn how to solder with tons of tutorials! (http://adafru.it/atk) Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 8 of 33

You will want rosin core, 60/40 solder. Good solder is a good thing. Bad solder leads to bridging and cold solder joints which can be tough to find. Click here to buy a spool of leaded solder (recommended for beginners). (http://adafru.it/145) Click here to buy a spool of lead-free solder. (http://adafru.it/734) Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 9 of 33

Circuit Diagram Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 10 of 33

Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 11 of 33

The Flora pixels are all connected to common ground bus, as well as a common power bus connected to VBATT. The Flora pixel data bus is connected to D6. The microphone amplifier is connected to 3.3V, GND, and D9. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 12 of 33

Battery Pouch & Flora Use a piece of scrap fabric to stitch a small pouch for your lipoly battery. The pouch should be stitched to the back of the tie, just above where the Flora goes, and have an opening at the top for easy removal of the battery for charging. Use a seam ripper to open up the back seam of the tie just a little so you can thread the JST plug and wire inside the tie and down to the Flora. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 13 of 33

The plug joins the Flora just inside the folds of the tie so it won't get caught on anything. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 14 of 33

Tack your Flora in place with plain thread by stitching some unused pads to the tie. Try to just stitch to the back surface of the tie so the front fabric remains smooth. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 15 of 33

Sewing Pixels Use a ruler to draw a line down the center of your tie with tailor's chalk, and evenly distribute your 16 Flora pixels along this line. Mark the position of each pixel with chalk. Stitch a long length of conductive thread to GND next to D6, only piercing the back surface of the tie. Stitch over to the (-) pad on your first pixel and Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 16 of 33

secure (but don't cut the thread). Add a few more pixels by connecting this long ground line to the (-) pads on the pixels. Stitch the data bus from D6 to the input pad on the first pixel (marked with an inward-facing arrow). Tie off, seal the knot, and snip the thread. Stitch small segments of conductive thread between each pixel, connecting the output of one Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 17 of 33

pixel to the input on the next. Check out our Conductive Thread guide (http://adafru.it/avx) for more tips on working with conductive thread! Use another long length of conductive thread to connect Flora's VBATT pad to the (+) pads on the pixels. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 18 of 33

Once you've stitched a few pixels, test for shorts with your multimeter (make sure your long power and ground threads aren't touching), and fire up the NeoPixel library test code to ensure your fledgeling circuit is all good so far. Stitch up the rest of the pixels - you'll have one long ground bus, one long power bus, and short segments between each input/output data pads. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 19 of 33

Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 20 of 33

Add Microphone To match the tie, paint your microphone amplifier with a little black nail polish. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 21 of 33

Cut a piece of ribbon cable longer than the main part of the tie. Peel off three wires to use with the microphone amplifier, which will live at the knot of the tie. Insert the ribbon cable up through the inside of the tie. Cut a small hole with a seam ripper inside the knot of the tie and bring the ribbon cable through it. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 22 of 33

Strip the ends of the wires and solder them up to the three holes on the microphone amplifier. Use plain thread to anchor the mic to the tie knot using the large mounting holes. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 23 of 33

Back at the Flora end of the board, solder the corresponding wires to 3.3V, GND, and D9. Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 24 of 33

The Code You'll need the NeoPixel library for this project. Download by clicking the ZIP button on the NeoPixel Github repository page (http://adafru.it/azu), and rename the resulting folder "Adafruit_NeoPixel" and move to your Arduino libraries folder. For more information on programming your Flora board including the software you need to do so, head over to the Getting Started with Flora (http://adafru.it/asz) guide. We got so excited about this project we made TWO Arduino sketches to meter the volume in the room (by Phil Burgess, James DeVito, and Andy Doro). You can download them both at the LED Ampli-Tie Github repo (http://adafru.it/azv) or copy from below. The first dynamically adjusts to whatever volume is happening: /* LED VU meter for Arduino and Adafruit NeoPixel LEDs. Hardware requirements: - Most Arduino or Arduino-compatible boards (ATmega 328P or better). - Adafruit Electret Microphone Amplifier (ID: 1063) - Adafruit Flora RGB Smart Pixels (ID: 1260) OR - Adafruit NeoPixel Digital LED strip (ID: 1138) - Optional: battery for portable use (else power through USB or adapter) Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 25 of 33

- Optional: battery for portable use (else power through USB or adapter) Software requirements: - Adafruit NeoPixel library Connections: - 3.3V to mic amp + - GND to mic amp - - Analog pin to microphone output (configurable below) - Digital pin to LED data input (configurable below) See notes in setup() regarding 5V vs. 3.3V boards - there may be an extra connection to make and one line of code to enable or disable. Written by Adafruit Industries. Distributed under the BSD license. This paragraph must be included in any redistribution. */ #include <Adafruit_NeoPixel.h> #define N_PIXELS 16 // Number of pixels in strand #define MIC_PIN A9 // Microphone is attached to this analog pin #define LED_PIN 6 // NeoPixel LED strand is connected to this pin #define DC_OFFSET 0 // DC offset in mic signal - if unusure, leave 0 #define NOISE 10 // Noise/hum/interference in mic signal #define SAMPLES 60 // Length of buffer for dynamic level adjustment #define TOP (N_PIXELS + 2) // Allow dot to go slightly off scale #define PEAK_FALL 40 // Rate of peak falling dot byte peak = 0, // Used for falling dot dotcount = 0, // Frame counter for delaying dot-falling speed volcount = 0; // Frame counter for storing past volume data int vol[samples], // Collection of prior volume samples lvl = 10, // Current "dampened" audio level minlvlavg = 0, // For dynamic adjustment of graph low & high maxlvlavg = 512; Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_PIXELS, LED_PIN, NEO_GRB + NEO_KHZ800); void setup() { // This is only needed on 5V Arduinos (Uno, Leonardo, etc.). // Connect 3.3V to mic AND TO AREF ON ARDUINO and enable this // line. Audio samples are 'cleaner' at 3.3V. // COMMENT OUT THIS LINE FOR 3.3V ARDUINOS (FLORA, ETC.): // analogreference(external); memset(vol, 0, sizeof(vol)); Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 26 of 33

memset(vol, 0, sizeof(vol)); strip.begin(); void loop() { uint8_t i; uint16_t minlvl, maxlvl; int n, height; n = analogread(mic_pin); // Raw reading from mic n = abs(n - 512 - DC_OFFSET); // Center on zero n = (n <= NOISE)? 0 : (n - NOISE); // Remove noise/hum lvl = ((lvl * 7) + n) >> 3; // "Dampened" reading (else looks twitchy) // Calculate bar height based on dynamic min/max levels (fixed point): height = TOP * (lvl - minlvlavg) / (long)(maxlvlavg - minlvlavg); if(height < 0L) height = 0; // Clip output else if(height > TOP) height = TOP; if(height > peak) peak = height; // Keep 'peak' dot at top // Color pixels based on rainbow gradient for(i=0; i<n_pixels; i++) { if(i >= height) strip.setpixelcolor(i, 0, 0, 0); else strip.setpixelcolor(i,wheel(map(i,0,strip.numpixels()-1,30,150))); // Draw peak dot if(peak > 0 && peak <= N_PIXELS-1) strip.setpixelcolor(peak,wheel(map(peak,0,strip.numpixels()-1,30,150) strip.show(); // Update strip // Every few frames, make the peak pixel drop by 1: if(++dotcount >= PEAK_FALL) { //fall rate if(peak > 0) peak--; dotcount = 0; Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 27 of 33

vol[volcount] = n; // Save sample for dynamic leveling if(++volcount >= SAMPLES) volcount = 0; // Advance/rollover sample counter // Get volume range of prior frames minlvl = maxlvl = vol[0]; for(i=1; i<samples; i++) { if(vol[i] < minlvl) minlvl = vol[i]; else if(vol[i] > maxlvl) maxlvl = vol[i]; // minlvl and maxlvl indicate the volume range over prior frames, used // for vertically scaling the output graph (so it looks interesting // regardless of volume level). If they're too close together though // (e.g. at very low volume levels) the graph becomes super coarse // and 'jumpy'...so keep some minimum distance between them (this // also lets the graph go to zero when no sound is playing): if((maxlvl - minlvl) < TOP) maxlvl = minlvl + TOP; minlvlavg = (minlvlavg * 63 + minlvl) >> 6; // Dampen min/max levels maxlvlavg = (maxlvlavg * 63 + maxlvl) >> 6; // (fake rolling average) // Input a value 0 to 255 to get a color value. // The colors are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { if(wheelpos < 85) { return strip.color(wheelpos * 3, 255 - WheelPos * 3, 0); else if(wheelpos < 170) { WheelPos -= 85; return strip.color(255 - WheelPos * 3, 0, WheelPos * 3); else { WheelPos -= 170; return strip.color(0, WheelPos * 3, 255 - WheelPos * 3); The second allows you to adjust the sensitivity of the VU meter: /* LED VU meter for Arduino and Adafruit NeoPixel LEDs. Hardware requirements: - Most Arduino or Arduino-compatible boards (ATmega 328P or better). - Adafruit Electret Microphone Amplifier (ID: 1063) Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 28 of 33

- Adafruit Electret Microphone Amplifier (ID: 1063) - Adafruit Flora RGB Smart Pixels (ID: 1260) OR - Adafruit NeoPixel Digital LED strip (ID: 1138) - Optional: battery for portable use (else power through USB or adapter) Software requirements: - Adafruit NeoPixel library Connections: - 3.3V to mic amp + - GND to mic amp - - Analog pin to microphone output (configurable below) - Digital pin to LED data input (configurable below) See notes in setup() regarding 5V vs. 3.3V boards - there may be an extra connection to make and one line of code to enable or disable. Written by Adafruit Industries. Distributed under the BSD license. This paragraph must be included in any redistribution. fscale function: Floating Point Autoscale Function V0.1 Written by Paul Badger 2007 Modified from code by Greg Shakar */ #include <Adafruit_NeoPixel.h> #include <math.h> #define N_PIXELS 16 // Number of pixels in strand #define MIC_PIN A9 // Microphone is attached to this analog pin #define LED_PIN 6 // NeoPixel LED strand is connected to this pin #define SAMPLE_WINDOW 10 // Sample window for average level #define PEAK_HANG 24 //Time of pause before peak dot falls #define PEAK_FALL 4 //Rate of falling peak dot #define INPUT_FLOOR 10 //Lower range of analogread input #define INPUT_CEILING 300 //Max range of analogread input, the lower the value the more sensitive (1023 = byte peak = 16; unsigned int sample; // Peak level of column; used for falling dots byte dotcount = 0; //Frame counter for peak dot byte dothangcount = 0; //Frame counter for holding peak dot Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_PIXELS, LED_PIN, NEO_GRB + NEO_KHZ800); Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 29 of 33

void setup() { // This is only needed on 5V Arduinos (Uno, Leonardo, etc.). // Connect 3.3V to mic AND TO AREF ON ARDUINO and enable this // line. Audio samples are 'cleaner' at 3.3V. // COMMENT OUT THIS LINE FOR 3.3V ARDUINOS (FLORA, ETC.): // analogreference(external); // Serial.begin(9600); strip.begin(); strip.show(); // Initialize all pixels to 'off' void loop() { unsigned long startmillis= millis(); // Start of sample window float peaktopeak = 0; // peak-to-peak level unsigned int signalmax = 0; unsigned int signalmin = 1023; unsigned int c, y; // collect data for length of sample window (in ms) while (millis() - startmillis < SAMPLE_WINDOW) { sample = analogread(mic_pin); if (sample < 1024) // toss out spurious readings { if (sample > signalmax) { signalmax = sample; // save just the max levels else if (sample < signalmin) { signalmin = sample; // save just the min levels peaktopeak = signalmax - signalmin; // max - min = peak-peak amplitude // Serial.println(peakToPeak); //Fill the strip with rainbow gradient Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 30 of 33

//Fill the strip with rainbow gradient for (int i=0;i<=strip.numpixels()-1;i++){ strip.setpixelcolor(i,wheel(map(i,0,strip.numpixels()-1,30,150))); //Scale the input logarithmically instead of linearly c = fscale(input_floor, INPUT_CEILING, strip.numpixels(), 0, peaktopeak, 2); if(c < peak) { peak = c; // Keep dot on top dothangcount = 0; // make the dot hang before falling if (c <= strip.numpixels()) { // Fill partial column with off pixels drawline(strip.numpixels(), strip.numpixels()-c, strip.color(0, 0, 0)); // Set the peak dot to match the rainbow gradient y = strip.numpixels() - peak; strip.setpixelcolor(y-1,wheel(map(y,0,strip.numpixels()-1,30,150))); strip.show(); // Frame based peak dot animation if(dothangcount > PEAK_HANG) { //Peak pause length if(++dotcount >= PEAK_FALL) { //Fall rate peak++; dotcount = 0; else { dothangcount++; //Used to draw a line between two points of a given color void drawline(uint8_t from, uint8_t to, uint32_t c) { uint8_t fromtemp; if (from > to) { fromtemp = from; from = to; to = fromtemp; for(int i=from; i<=to; i++){ Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 31 of 33

for(int i=from; i<=to; i++){ strip.setpixelcolor(i, c); float fscale( float originalmin, float originalmax, float newbegin, float newend, float inputvalue, float curve){ float OriginalRange = 0; float NewRange = 0; float zerorefcurval = 0; float normalizedcurval = 0; float rangedvalue = 0; boolean invflag = 0; // condition curve parameter // limit range if (curve > 10) curve = 10; if (curve < -10) curve = -10; curve = (curve * -.1) ; // - invert and scale - this seems more intuitive - postive numbers give more weight to h curve = pow(10, curve); // convert linear scale into lograthimic exponent for other pow function /* Serial.println(curve * 100, DEC); // multply by 100 to preserve resolution Serial.println(); */ // Check for out of range inputvalues if (inputvalue < originalmin) { inputvalue = originalmin; if (inputvalue > originalmax) { inputvalue = originalmax; // Zero Refference the values OriginalRange = originalmax - originalmin; if (newend > newbegin){ NewRange = newend - newbegin; else { Adafruit Industries https://learn.adafruit.com/led-ampli-tie Page 32 of 33

{ NewRange = newbegin - newend; invflag = 1; zerorefcurval = inputvalue - originalmin; normalizedcurval = zerorefcurval / OriginalRange; // normalize to 0-1 float // Check for originalmin > originalmax - the math for all other cases i.e. negative numbers seems to work out if (originalmin > originalmax ) { return 0; if (invflag == 0){ rangedvalue = (pow(normalizedcurval, curve) * NewRange) + newbegin; else // invert the ranges { rangedvalue = newbegin - (pow(normalizedcurval, curve) * NewRange); return rangedvalue; // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { if(wheelpos < 85) { return strip.color(wheelpos * 3, 255 - WheelPos * 3, 0); else if(wheelpos < 170) { WheelPos -= 85; return strip.color(255 - WheelPos * 3, 0, WheelPos * 3); else { WheelPos -= 170; return strip.color(0, WheelPos * 3, 255 - WheelPos * 3); Adafruit Industries Last Updated: 2015-08-29 03:02:04 PM EDT Page 33 of 33

Wear it! Take your tie out on the town! It's perfect for parties, concerts, weddings, Bar Mitzvahs... If you need to wash your tie, remove the battery and gently spot clean-- the pixels, thread and Flora board can handle getting wet (then dry throrougly), but water should not get in the microphone.