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

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

Celebration Spectacles

LED Stego Flex Spike Hoodie

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

NeoPixel Basketball Hoop

Crystal Glow Knuckles

NeoPixel Ring Bangle Bracelet

Light-Up Angler Fish Embroidery

Getting Started with FLORA

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

Adafruit TPL5111 Reset Enable Timer Breakout

Adafruit TPL5110 Power Timer Breakout

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

Getting Started with FLORA

Mystical LED Halloween Hood

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

3D Printed Camera LED Ring

NeoPixel LED Cortana Costume

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

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

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

Guardian Shield+ Zelda Breath of the Wild

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

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

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

3D Printed Daft Punk Helmet with Bluetooth

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

Trinket NeoPixel LED Longboard

Camera LED Ring Light

Chirping Plush Owl Toy

Kaleidoscope Eyes (Trinket-Powered NeoPixel LED Ring Goggles)

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

Bike Wheel POV Display

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

NeoMatrix 8x8 Word Clock

Bunny Ears with MakeCode

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

Portable Apple Watch Charger

3D Printed LED Microphone Flag

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

Lie Ren's Stormflower Gun Blade

Simple LED Unicorn Horn

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

LED Eyes. Created by Ruiz Brothers. Last updated on :50:55 AM UTC

Infinity Mirror Valentine's Candy Box

NeoPixie Dust Bag with Circuit Playground Express

Trinket-Powered Conference Room Occupancy Display

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

Flora Brake Light Backpack

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

Adafruit Capacitive Touch Sensor Breakouts

Bluetooth Controlled NeoPixel Headphones

NeoPixel Bike Light. Created by Ruiz Brothers. Last updated on :43:46 PM UTC

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

Interactive Gift Box. Created by codingpro. Last updated on :47:40 AM UTC

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

Adafruit APDS9960 breakout

GPS Logging Dog Harness

Adafruit 1.27" and 1.5" Color OLED Breakout Board

Glowing LED Chair. Created by Ruiz Brothers. Last updated on :01:47 AM UTC

3D Printed LED Buckle

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

'Sup Brows. Created by Kate Hartman. Last updated on :52:04 PM UTC

PyPortal NeoPixel Color Picker Created by Kattni Rembor. Last updated on :42:41 PM UTC

Getting Started with FLORA

Easy Sparkle Pocket T-Shirt

Adafruit Mini TFT " 160x80

Circuit Playground Yoyo

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

NeoPixel Fairy Crown. Created by Erin St Blaine. Last updated on :22:47 AM UTC

Adabot Operation Game

Android GBoard Morse Code Control with Circuit Playground Express

Trellis 3D Printed Enclosure

Monochrome OLED Breakouts

Joy Featherwing. Created by Dean Miller. Last updated on :03:07 PM UTC

CircuitPython Media Dial

7 Portable Multitouch Raspberry Pi Tablet

MCP Bit DAC Tutorial

Unicorn Hat with Moving Ears

PyPortal View Master Created by Ruiz Brothers. Last updated on :51:28 AM UTC

Flora Wearable GPS. Created by Becky Stern. Last updated on :32:36 PM UTC

3d Printed Neopixel Tactile Switch Buttons

LED Breath Stats Mask

MCP Bit DAC Tutorial

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

Con Badge with Circuit Playground Express

Adafruit I2C FRAM Breakout

Adafruit Color Sensors

Adafruit PowerBoost 500 Shield

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

Crawling Animatronic Hand

Phone-Activated Talking Dog Collar

Adafruit AMG8833 8x8 Thermal Camera Sensor

Milk Jug Glow Skull. Created by John Park. Last updated on :28:36 PM UTC

Adafruit Si7021 Temperature + Humidity Sensor

Adafruit DRV2605 Haptic Controller Breakout

LED Campfire. Created by Erin St Blaine. Last updated on :34:11 PM UTC

Galaxy Pendant. Created by Erin St Blaine. Last updated on :44:15 PM UTC

7" Portable HDMI Monitor

Adafruit ATWINC1500 WiFi Breakout

Transcription:

Cyberpunk Spikes Created by Becky Stern Last updated on 2017-10-20 09:07:06 PM UTC

Guide Contents Guide Contents Overview Download and 3D Print Prepare NeoPixel Strip Assemble Circuit Arduino Code CircuitPython Code Wear it! 2 3 6 8 11 15 18 21 Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 2 of 24

Overview This guide was written for the Gemma board, but can be done with either the v1, v2 or Gemma M0. We recommend the Gemma M0 as it is easier to use and is more compatible with modern computers! Before you get started, follow the Gemma M0 guide or the Classic Introducing GEMMA guide Make your own flexible, spiky, glowing accessory using NeoPixel strip diffused by NinjaFlex flexible 3D printing filament! Magnets let you attach the spikes to anything in your wardrobe. The soft flexible enclosure holds GEMMA, the tiny microcontroller that animates the LEDs, and a rechargeable lipoly battery. For this project you will need: Gemma M0 or GEMMA v2 wearable microcontroller (the Trinket M0 would also work) 60 LED per meter NeoPixel strip (1 meter) NinjaFlex Snow White flexble 3D printing filament slide switch JST extension 500mAh lipoly battery six rare earth magnets safety pins or needle and thread Permatex 66B silicone adhesive Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 3 of 24

It's easy to wear your spikes around your collar, over your shoulder, in your hair, on the strap of a bag, and even in your hair. How will you wear it? We'd love to see your versions on our weekly show and tell on Google+! Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 4 of 24

Portaits by Andrew Tingle. Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 5 of 24

Download and 3D Print We designed two styles of spike strip-- one with regular round spikes and one crystal-inspired statement piece. Download whichever spikes you like and print in NinjaFlex filament at 225 degrees with a non-heated build plate. For more tips on working with NinjaFlex, check out our NinjaFlex guide. Download 3D spike files on Thingiverse https://adafru.it/dat Also print the two pieces of the flexible enclosure for the GEMMA and battery. Since it's printed in NinjaFlex, the enclosure is soft and flexible, yet firm enough to protect your components. The enclosure shape includes tabs for pinning or sewing to your garment. Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 6 of 24

Dowload enclosure files on Thingiverse https://adafru.it/dau Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 7 of 24

Prepare NeoPixel Strip Prepare the input end of your NeoPixel strip by tinning the pads with solder. The strip won't work if you solder wires to the wrong end, so be sure the arrows on the PCB point away from the end you're wiring. Solder three stranded wires, about eight inches long each, to the tinned pads of the NeoPixel strip. To help avoid the solder joints from being too cramped, solder the center pad's wire on the reverse side of the PCB (two on top, one on bottom), as shown. Wrap three rare earth magnets in tape to prevent short circuits, and slide them into the NeoPixel strip sheathing, on the underside of the PCB. Our spike strip is 16 pixels long, and we used three magnets evenly spaced (one at each end and one in the center). Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 8 of 24

Prepare a protected work surface in an area with good ventilation. Use Permatex 66B silicone adhesive to affix the 3D printed spikes to the NeoPixel strip. Apply both to the strip's silicone sheathing and the NinjaFlex strip of spikes, using a toothpick to spread it around if necessary. Squish a bit of silicone adhesive into the ends of the NeoPixel strip sheathing to provide water resistance and strain relief. Allow adhesive to dry overnight. Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 9 of 24

Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 10 of 24

Assemble Circuit This diagram uses the original Gemma but you can also use the Gemma M0 with the exact same wiring! Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 11 of 24

Route your NeoPixel strip's wires through the hole at the top of the enclosure, and solder them up to GEMMA: NeoPixel GND -> GEMMA GND NeoPixel + -> GEMMA Vout NeoPixel signal -> GEMMA D1 Seat GEMMA into the round outline inside the enclosure, with the USB port facing its opening at the bottom end of the enclosure. Use a JST extension and slide switch to make this tiny Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 12 of 24

adapter. The slide switch fits into the opening in the enclosure and now you can easily power up your circuit while still making it easy to disconnect the battery for recharging. Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 13 of 24

Fit everything neatly in the enclosure and press on the lid. Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 14 of 24

Arduino Code The Arduino code presented below works equally well on all versions of GEMMA: v1, v2 and M0. But if you have an M0 board, consider using the CircuitPython code on the next page of this guide, no Arduino IDE required! Click to Download the NeoPixel Library https://adafru.it/cdj First test your NeoPixel strip using the strandtest sketch after having downloaded the NeoPixel library for your GEMMA-modded Arduino. Did that sound like gibberish to you? Read the Intoducing GEMMA and NeoPixel guides. Installing Arduino libraries is a frequent stumbling block. If this is your first time, or simply needing a refresher, please read the All About Arduino Libraries tutorial. If the library is correctly installed (and the Arduino IDE is restarted), you should be able to navigate through the File rollover menus as follows: File Sketchbook Libraries Adafruit_NeoPixel strandtest Connect up your NeoPixels in a solderless breadboard and use alligator clips to attach to GEMMA, referring to the circuit diagram if necessary. You ll need to change a few lines in the code regarding the data pin (1), type of pixels (RGB vs GRB), and number of pixels (5). The resulting (and slightly simplified) code is below: #include <Adafruit_NeoPixel.h> #define PIN 1 // Parameter 1 = number of pixels in strip // Parameter 2 = pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/ws2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800); // Here is where you can put in your favorite colors that will appear! // just add new {nnn, nnn, nnn, lines. They will be picked out randomly // R G B uint8_t mycolors[][3] = {{232, 100, 255, // purple {200, 200, 20, // yellow {30, 200, 200, // blue ; // don't edit the line below #define FAVCOLORS sizeof(mycolors) / 3 void setup() { strip.begin(); strip.setbrightness(40); strip.show(); // Initialize all pixels to 'off' Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 15 of 24

void loop() { flashrandom(5, 8); // first number is 'wait' delay, shorter num == shorter twinkle flashrandom(5, 5); // second number is how many neopixels to simultaneously light up flashrandom(5, 11); colorwipe(strip.color(232, 100, 255), 50); // Red colorwipe(strip.color(200, 200, 20), 50); // Green colorwipe(strip.color(30, 200, 200), 50); // Blue rainbowcycle(20); // Fill the dots one after the other with a color void colorwipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i<strip.numpixels(); i++) { strip.setpixelcolor(i, c); strip.show(); delay(wait); void rainbow(uint8_t wait) { uint16_t i, j; for(j=0; j<256; j++) { for(i=0; i<strip.numpixels(); i++) { strip.setpixelcolor(i, Wheel((i+j) & 255)); strip.show(); delay(wait); // Slightly different, this makes the rainbow equally distributed throughout void rainbowcycle(uint8_t wait) { uint16_t i, j; for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel for(i=0; i< strip.numpixels(); i++) { strip.setpixelcolor(i, Wheel(((i * 256 / strip.numpixels()) + j) & 255)); strip.show(); delay(wait); // 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); void flashrandom(int wait, uint8_t howmany) { Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 16 of 24

void flashrandom(int wait, uint8_t howmany) { for(uint16_t i=0; i<howmany; i++) { // pick a random favorite color! int c = random(favcolors); int red = mycolors[c][0]; int green = mycolors[c][1]; int blue = mycolors[c][2]; // get a random pixel from the list int j = random(strip.numpixels()); // now we will 'fade' it in 5 steps for (int x=0; x < 5; x++) { int r = red * (x+1); r /= 5; int g = green * (x+1); g /= 5; int b = blue * (x+1); b /= 5; strip.setpixelcolor(j, strip.color(r, g, b)); strip.show(); delay(wait); // & fade out in 5 steps for (int x=5; x >= 0; x--) { int r = red * x; r /= 5; int g = green * x; g /= 5; int b = blue * x; b /= 5; strip.setpixelcolor(j, strip.color(r, g, b)); strip.show(); delay(wait); // LEDs will be off when done (they are faded to 0) From the Tools Board menu, select the device you are using: Adafruit Gemma M0 Adafruit Gemma 8 MHz Connect the USB cable between the computer and your device. The original Gemma (8 MHz) need the reset button pressed on the board, then click the upload button (right arrow icon) in the Arduino IDE. You do not need to press the reset on the newer Gemma M0. When the battery is connected, you should get a light show from the LEDs. All your pixels working? Great! You can take apart this prototype and get ready to put the pixels in the collar. Refer to the NeoPixel Uberguide for more info. Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 17 of 24

CircuitPython Code GEMMA M0 boards can run CircuitPython a different approach to programming compared to Arduino sketches. In fact, CircuitPython comes factory pre-loaded on GEMMA M0. If you ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the Adafruit GEMMA M0 guide. These directions are specific to the M0 GEMMA board. The original GEMMA with an 8-bit AVR microcontroller doesn t run CircuitPython for those boards, use the Arduino sketch on the Arduino code page of this guide. Below is CircuitPython code that works similarly (though not exactly the same) as the Arduino sketch shown on a prior page. To use this, plug the GEMMA M0 into USB it should show up on your computer as a small flash drive then edit the file main.py with your text editor of choice. Select and copy the code below and paste it into that file, entirely replacing its contents (don t mix it in with lingering bits of old code). When you save the file, the code should start running almost immediately (if not, see notes at the bottom of this page). If GEMMA M0 doesn t show up as a drive, follow the GEMMA M0 guide link above to prepare the board for CircuitPython. from digitalio import DigitalInOut, Direction import board import neopixel import time try: import urandom as random except ImportError: import random pixpin = board.d1 numpix = 16 Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 18 of 24

led = DigitalInOut(board.D13) led.direction = Direction.OUTPUT strip = neopixel.neopixel(pixpin, numpix, brightness=.2, auto_write=true) colors = [ [ 232, 100, 255 ], # Purple [ 200, 200, 20 ], # Yellow [ 30, 200, 200 ], # Blue ] # Fill the dots one after the other with a color def colorwipe(color, wait): for j in range(len(strip)): strip[j] = (color) time.sleep(wait) def rainbow(wait): for j in range(255): for i in range(len(strip)): idx = int (i+j) strip[i] = wheel(idx & 255) # Slightly different, this makes the rainbow equally distributed throughout def rainbow_cycle(wait): for j in range(255*5): for i in range(len(strip)): idx = int ((i * 256 / len(strip)) + j) strip[i] = wheel(idx & 255) time.sleep(wait) # Input a value 0 to 255 to get a color value. # The colours are a transition r - g - b - back to r. def wheel(pos): # Input a value 0 to 255 to get a color value. # The colours are a transition r - g - b - back to r. if (pos < 0) or (pos > 255): return (0, 0, 0) if (pos < 85): return (int(pos * 3), int(255 - (pos*3)), 0) elif (pos < 170): pos -= 85 return (int(255 - pos*3), 0, int(pos*3)) else: pos -= 170 return (0, int(pos*3), int(255 - pos*3)) def flash_random(wait,howmany): for k in range(howmany): c = random.randint(0, len(colors) - 1) # Choose random color index j = random.randint(0, numpix - 1) # Choose random pixel strip[j] = colors[c] # Set pixel to color for i in range(1, 5): strip.brightness = i / 5.0 time.sleep(wait) # Ramp up brightness Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 19 of 24

for i in range(5, 0, -1): strip.brightness = i / 5.0 strip[j] = [0,0,0] time.sleep(wait) # Ramp down brightness # Set pixel to 'off' while True: flash_random(.01, 8) # first number is 'wait' delay, shorter num == shorter twinkle flash_random(.01, 5) # second number is how many neopixels to simultaneously light up flash_random(.01, 11) colorwipe( (232, 100, 255),.1 ) colorwipe( (200, 200, 20),.1 ) colorwipe( (30, 200, 200),.1) rainbow_cycle(0.05) This code requires the neopixel.py library. A factory-fresh board will have this already installed. If you ve just reloaded the board with CircuitPython, create the lib directory and then download neopixel.py from Github. Download neopixel.py from GitHub https://adafru.it/yew Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 20 of 24

Wear it! You can use the included holes to stitch or pin the enclosure to your underarm or wherever you'd like to put it. For more permanent use, stitch a pocket for this enclosure on the inside of your garment and route the wires to the inside. Use a fluffy bun-maker hair accessory and tuck the enclosure under it to wear these spikes around your head! Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 21 of 24

Epaulets, two styles Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 22 of 24

Around the collar Adafruit Industries https://learn.adafruit.com/cyberpunk-spikes Page 23 of 24

Cyber dragon, anyone? Since you sealed up the strip with adhesive, this accessory is fairly water-resistant. Turn it off and remove the battery if you get stuck in a torrential downpour! Adafruit Industries Last Updated: 2017-10-20 09:07:06 PM UTC Page 24 of 24