Dec 25, 2013 ... This is an all-sew project with no batteries, making it great for ... We've made a
PDF pattern for constructing this plush controller. ... Paste the following code into
the Adafruit Arduino IDE or download the code .... the edge of this piece for easy
... into your computer and start playing your favorite games online!
Plush Game Controller Created by Becky Stern
Last updated on 2015-02-20 01:16:31 PM EST
Guide Contents Guide Contents Overview Pattern & Circuit Diagram Stitch Circuit The Code Construct Plushie Use it!
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
2 3 4 7 14 18 25
Page 2 of 25
Overview Make an oversize plush game controller that actually works! Use conductive fabric and a Flora board to stitch up a capacitive touch sensing circuit. The controller acts like a computer keyboard, allowing you to play all your favorite old school games on emulator sites online. This is an all-sew project with no batteries, making it great for beginners and even kids to try. Read on to build your own! Special assistance creating this project provided by Risa Rose.
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 3 of 25
Pattern & Circuit Diagram
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 4 of 25
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 5 of 25
We've made a PDF pattern for constructing this plush controller. Download the tiled PDF (http://adafru.it/c5Y), print it out and tile the four pages together. We've also made available the pattern Illustrator file (http://adafru.it/c5Z) if you'd like to make any changes.
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 6 of 25
Stitch Circuit Iron a small piece of double-sided iron-on interfacing (http://adafru.it/c60) to a piece of woven conductive fabric. I like this mini iron (http://adafru.it/c61) for better control with small pieces.
Peel off the paper backing (or don't), and cut out the shapes necessary for your controller buttons refer to your pattern! You'll have four directional buttons, two option buttons, and two round action buttons.
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 7 of 25
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 8 of 25
If you haven't already, peel the backing from the interfacing and then iron the pieces of conductive fabric to some grey fuzzy fabric. Don't place them too close to the edge of your fabric, or you won't have anything to grip onto with your embroidery hoop in the next steps.
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 9 of 25
Place the Flora on the fabric, and following the pattern use a water-soluble embroidery (http://adafru.it/c62) marker to sketch the traces that will connect the Flora pads to the conductive fabric buttons. It's important that these traces are as far apart from each other as possible so they don't accidentally trigger each other's capacitive touch sensing. We've tested this particular pattern and it works great; we also made previous versions with traces closer together that did not work well, so keep that in mind if you're designing your own button layout.
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 10 of 25
Embroider connections that follow the lines you just drew, wrapping several times around the Flora pads and into the conductive fabric, then knot, seal, and cut the thread at the back. For more information about working with conductive thread, check out our Conductive © Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 11 of 25
Thread (http://adafru.it/aVx) guide. Remove the circuit from the embroidery hoop and iron out any creases.
Blot the blue traces with a damp paper towel to make it disappear.
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 12 of 25
© Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 13 of 25
The Code Paste the following code into the Adafruit Arduino IDE or download the code from Github (http://adafru.it/c63). For more information about programming Flora and to download the IDE, please visit the Getting Started with FLORA guide (http://adafru.it/aSZ). You'll need Modern Device's capacitive touch sensing library (http://adafru.it/c66) for Arduino. /* Example code for a Flora game controller with capacitive touch sensing! Full tutorial and video: http://learn.adafruit.com/plush-game-controller/ Uses Modern Device's Capacitive Sensing library: https://github.com/moderndevice/CapSense Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried & Becky Stern for Adafruit Industries. BSD license, all text above must be included in any redistribution */ #include CapPin cPin_10 = CapPin(10); CapPin cPin_9 = CapPin(9); CapPin cPin_6 = CapPin(6); CapPin cPin_12 = CapPin(12); CapPin cPin_1 = CapPin(1); CapPin cPin_0 = CapPin(0); CapPin cPin_2 = CapPin(2); CapPin cPin_3 = CapPin(3);
// read pin 10 (D10 on Flora) - connect to NES B // read pin 9 (D9 on Flora) - connect to NES A // read pin 6 (D6 on Flora) - connect to NES Start // read pin 12 (D12 on Flora) - connect to NES Select // read pin 1 (TX on Flora) - connect to NES right // read pin 0 (RX on Flora) - connect to NES up // read pin 2 (SDA on Flora) - connect to NES left // read pin 3 (SCL on Flora) - connect to NES down
CapPin pins[] = {cPin_10, cPin_9, cPin_6, cPin_12, cPin_1, cPin_0, cPin_2, cPin_3}; // check http://arduino.cc/en/Reference/KeyboardModifiers for more info on unique keys // WASD D-pad, select = Return, start = Space, LeftButton = z, RightButton = x //char Keys[] = { 'x', 'z', ' ', KEY_RETURN, 'd', 'w', 'a', 's'}; // arrow D-pad, select = Return, start = Space, LeftButton = b, RightButton = a char Keys[] = { 'a', 'b', ' ', KEY_RETURN, KEY_RIGHT_ARROW, KEY_UP_ARROW, KEY_LEFT_ARROW boolean currentPressed[] = {false, false, false, false, false, false, false, false}; // Capactive touch threashhold, you might want to mess with this if you find its too // sensitive or not sensitive enough © Adafruit Industries
https://learn.adafruit.com/plush-game-controller
Page 14 of 25
// sensitive or not sensitive enough #define THRESH 500 float smoothed[8] = {0,0,0,0,0,0,0,0}; void setup() { //while (!Serial) Serial.begin(115200); Serial.println("start"); Keyboard.begin(); }
void loop() { for (int i=0;i THRESH) && (! currentPressed[i])) { Serial.print("Key pressed #"); Serial.print(i); Serial.print(" ("); Serial.print(Keys[i]); Serial.println(")"); currentPressed[i] = true; Keyboard.press(Keys[i]); } else if ((total 1){ // check to make sure param's are within range filterVal = .999999; } else if (filterVal