[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/110/original/hero.jpeg?1724257591","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003eOverview\u003c/h1\u003e\n\u003cp\u003eA few years ago I got this \u003ca href=\"https://www.adafruit.com/product/5255\"\u003enifty LED glasses kit\u003c/a\u003e in an Adabox. The kit comes with a specially-designed \u003ca href=\"https://www.adafruit.com/product/5217\"\u003enRF52840 BLE microcontroller\u003c/a\u003e to drive the LEDs wirelesslly with Bluetooth Low Energy. I wanted to build a simple controller that I could pair with it for easy use, without having to dig out my phone and use an app, so I built a an adapter to essentially convert a Wii Nunchuck into a wireless Bluetooth controller.\u003c/p\u003e\n\u003cp\u003eThis controller doesn't strictly have to be used to control LED glasses though. You can use it to control virtually any gadget with BLE capabilities. The Nunchuck features 2 buttons, an analog stick, and an accelerometer, so it makes a capable and handy input device for many tasks. Since it uses a Feather nRF52840 Express, you can program it in Arduino or CircuitPython to behave just how you want!\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDifficulty: Intermediate.\u003c/strong\u003e Some soldering is required.\u003c/p\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003eParts\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003ca href=\"https://www.adafruit.com/product/4062\" target=\"_blank\"\u003eFeather nRF52840 Express\u003c/a\u003e\u0026nbsp;\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.adafruit.com/product/4836\" target=\"_blank\"\u003eWii Nunchuck adapter breakout\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.adafruit.com/product/3870\" target=\"_blank\"\u003eMini on/off push-button switch\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.adafruit.com/product/3898\" target=\"_blank\"\u003e400 mAh Li-Po rechargeable battery\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\n\u003ca href=\"https://www.adafruit.com/product/3299\" target=\"_blank\"\u003eBlack 2.5mm nylon standoff screw kit\u003c/a\u003e\n\u003cul\u003e\n\u003cli\u003e4 M2.5 6mm screws\u003c/li\u003e\n\u003cli\u003e4 M2.5 6mm male-to-female hex standoffs\u003c/li\u003e\n\u003cli\u003e8 M2.5 hex nuts\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.adafruit.com/product/342\" target=\"_blank\"\u003eWii Nunchuck controller\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003e3D Printing\u003c/h1\u003e\n\u003cp\u003eThe 3D files for printing can be found \u003ca href=\"https://www.printables.com/model/981679-wii-nunchuck-ble-adapter\"\u003ehere\u003c/a\u003e. The bottom part of the case and the button mount are printed with black PLA. The top part of the case is printed in white PLA as a simple method of allowing the indicator LEDs on the Feather and the nunchuck breakout to be visible with the case closed. The button mount slides into a slot in the bottom case geometry, and the top part of the case snap-fits onto the bottom.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/113/original/3d-parts.jpeg?1724258838","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003eAssembly/Wiring\u003c/h1\u003e\n\u003col\u003e\n\u003cli\u003eSolder wires from the Wii nunchuck breakout's \u003cstrong\u003eVIN\u003c/strong\u003e, \u003cstrong\u003eSDA\u003c/strong\u003e, and \u003cstrong\u003eSCL\u003c/strong\u003e pins to the \u003cstrong\u003e3V\u003c/strong\u003e, \u003cstrong\u003eSDA\u003c/strong\u003e, and \u003cstrong\u003eSDL\u003c/strong\u003e pins on the Feather, respectively.\u0026nbsp;\u003c/li\u003e\n\u003cli\u003eSolder a wire to one lead from the on/off switch. Solder the other end of the wire to the \u003cstrong\u003eEN\u003c/strong\u003e pin of the Feather.\u003c/li\u003e\n\u003cli\u003eSolder a wire to the \u003cstrong\u003eGND\u003c/strong\u003e pin of the Wii nunchuck breakout, and another to the remaining lead on the on/off button. Splice the two wires together, and then solder the spliced end to the \u003cstrong\u003eGND\u003c/strong\u003e pin of the Feather.\u003c/li\u003e\n\u003cli\u003eUse 4 screws and 4 hex nuts to fasten the Wii nunchuck breakout to the 3D printed case.\u0026nbsp;\u003c/li\u003e\n\u003cli\u003ePlug the battery into the Feather.\u003c/li\u003e\n\u003cli\u003e(Optional) You may want to use a small bit of double-sided tape (I used VHB foam tape) to fasten the battery to the underside of the Feather to keep it from jiggling around. I positioned the battery to be closer to the micro-USB end of the Feather, away from the antenna on the other end as much as possible.\u003c/li\u003e\n\u003cli\u003eUse 4 male-to-female hex standoffs and 4 hex nuts to fasten the Feather to the case. The battery should sit nicely underneath the Feather, thanks to the standoffs.\u003c/li\u003e\n\u003cli\u003eSlide in the 3D printed button mount piece into the slot in the case near the nunchuck breakout (it's a tight fit).\u003c/li\u003e\n\u003cli\u003ePosition the on/off button so that it fits into the hole in the top of the 3D printed case, and then snap the top of the case to the bottom, making sure the side of the lid the on/off button is placed over the button mount geometry, and that the button stays in place in the hole in the top piece.\u003c/li\u003e\n\u003cli\u003ePlug the Wii Nunchuck controller into the adapter.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eUse the on/off button on the top of the adapter to toggle the power.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/116/original/disassembled.jpeg?1724259029","metadata":{"caption":""}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/111/original/partially-assembled.jpeg?1724258625","metadata":{"caption":""}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/114/original/assembled.jpeg?1724258998","metadata":{"caption":""}},{"element_type":"text","content":"\n        \u003ch1\u003eWhat next?\u003c/h1\u003e\n\u003cp\u003eUse \u003ca href=\"https://www.arduino.cc/en/software\"\u003eArduino\u003c/a\u003e, \u003ca href=\"https://circuitpython.org/board/feather_nrf52840_express/\"\u003eCircuitPython\u003c/a\u003e, \u003ca href=\"https://platformio.org/\"\u003ePlatformIO\u003c/a\u003e, or the Nordic SDK to program the adapter to your specifications. Or...\u003c/p\u003e\n\u003ch2\u003eCustom firmware\u003c/h2\u003e\n\u003cp\u003eI wrote some\u0026nbsp;\u003ca href=\"https://platformio.org/\"\u003ePlatformIO\u003c/a\u003e firmware to interact with \u003ca href=\"https://adafruit-playground.com/u/squid_jpg/pages/sparkle-specs-firmware-for-adafruit-led-glasses-driver\"\u003ecustom firmware I wrote for the Adafruit LED glasses kit\u003c/a\u003e, available \u003ca href=\"https://github.com/apendley/nunchuck-ble/\"\u003ehere\u003c/a\u003e. You might be able to pair it with another device, but it probably won't do anything without modifications to the code.\u003c/p\u003e\n\u003ch2\u003eFirmware installation\u003c/h2\u003e\n\u003cp\u003eThere are two ways to install the firmware: by installing the UF2 binary on the Feather nrf52840 Express directly, or by building from source and installing with PlatformIO.\u003c/p\u003e\n\u003ch3\u003e\u003cstrong\u003eUF2\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eFor easy installation, you can install the pre-built UF2 file using the following steps:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eDownload the UF2 file \u003ca href=\"https://github.com/apendley/nunchuck-ble/raw/main/blechuck.uf2\"\u003ehere\u003c/a\u003e\n\u003c/li\u003e\n\u003cli\u003ePlug in the Feather into to your computer's USB port\u003c/li\u003e\n\u003cli\u003eClick the reset button on the Feather twice\u003c/li\u003e\n\u003cli\u003eThe\u0026nbsp;\u003cstrong\u003eFTHR840BOOT\u003c/strong\u003e drive should appear on on your computer\u003c/li\u003e\n\u003cli\u003eCopy the UF2 file you downloaded in step 1 to the\u0026nbsp;\u003cstrong\u003eFTHR840BOOT\u003c/strong\u003e drive\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThat's it!\u003c/p\u003e\n\u003ch3\u003e\u003cstrong\u003eBuild from source\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eFor this project I chose to use the PlatformIO environment. I recommend using\u0026nbsp;\u003ca href=\"https://code.visualstudio.com/\"\u003eVisual Studio Code\u003c/a\u003e with the \u003ca href=\"https://docs.platformio.org/en/latest/integration/ide/pioide.html\"\u003ePlatformIO IDE\u003c/a\u003e plugin. Once PlatformIO is installed, you can download the \u003ca href=\"https://github.com/apendley/nunchuck-ble\"\u003esource code for the project from github\u003c/a\u003e. Open the project in the VSCode workspace. Make sure your the adapter is plugged in to your computer, and press the \u003cstrong\u003eUpload\u003c/strong\u003e button in the top right of the VSCode screen. The code should compile and upload to your adapter.\u003c/p\u003e\n      ","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/133/original/upload.jpeg?1725216911","metadata":{"caption":""}}]