[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/110/original/Staff_Full_Size.jpg?1766780456","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  \n        \u003ch2\u003eINTRODUCTION\u003c/h2\u003e\n\u003cp\u003eHey all!\u003c/p\u003e\n\u003cp\u003eI wanted to share my wizard crystal scepter / staff build, aimed towards renaissance fairs or Halloween costumes.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eThe majority of this prop is built using 1\" PVC Pipe, found at any big box hardware store such as Lowes or Home Depot. There are a few 3D printed components.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eSome experience with coding is recommended.\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\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        \u003ch2\u003eREQUIRED 3D PRINTED PARTS\u003c/h2\u003e\n\u003cp\u003ehttps://makerworld.com/en/models/2161070-wizard-crystal-scepter-staff#profileId-2343062\u003c/p\u003e\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        \u003ch2\u003eREQUIRED COMPONENTS\u003c/h2\u003e\n\u003cp\u003e1x SPDT Slide Switch \u003ca href=\"https://www.adafruit.com/product/805\"\u003ehttps://www.adafruit.com/product/805\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e1x Button Switch \u003ca href=\"https://www.adafruit.com/product/367\"\u003ehttps://www.adafruit.com/product/367\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e1x RP2040 PropMaker board \u003ca href=\"https://www.adafruit.com/product/5768\"\u003ehttps://www.adafruit.com/product/5768\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e1x Lithium Ion 3.7v battery \u003ca href=\"https://www.adafruit.com/product/1781\"\u003ehttps://www.adafruit.com/product/1781\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e3 conductor wire (at least 6-7 feet in length)\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://www.amazon.com/dp/B0DMK8HK6R?ref=ppx_yo2ov_dt_b_fed_asin_title\u0026amp;th=1\"\u003ehttps://www.amazon.com/dp/B0DMK8HK6R?ref=ppx_yo2ov_dt_b_fed_asin_title\u0026amp;th=1\u003c/a\u003e (or similar)\u003c/p\u003e\n\u003cp\u003e1x 5ft 1\" PVC Pipe \u003ca href=\"https://www.lowes.com/pd/Charlotte-Pipe-1-in-dia-x-5-ft-L-450-PSI-PVC-Pipe/3133093\"\u003ehttps://www.lowes.com/pd/Charlotte-Pipe-1-in-dia-x-5-ft-L-450-PSI-PVC-Pipe/3133093\u003c/a\u003e (Or similar)\u003c/p\u003e\n\u003cp\u003e1x 1\" PVC Pipe Cap \u003ca href=\"https://www.homedepot.com/p/Charlotte-Pipe-1-in-PVC-Socket-Schedule-40-Pressure-Cap-PVC021161000HD/203818100?source=shoppingads\u0026amp;locale=en-US\u0026amp;fp=ggl\"\u003ehttps://www.homedepot.com/p/Charlotte-Pipe-1-in-PVC-Socket-Schedule-40-Pressure-Cap-PVC021161000HD/203818100?source=shoppingads\u0026amp;locale=en-US\u0026amp;fp=ggl\u003c/a\u003e (or similar)\u003c/p\u003e\n\u003cp\u003eEVA Foam. I used 5mm thickness.\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://www.amazon.com/dp/B08YXXCG6J?ref=ppx_yo2ov_dt_b_fed_asin_title\u0026amp;th=1\"\u003ehttps://www.amazon.com/dp/B08YXXCG6J?ref=ppx_yo2ov_dt_b_fed_asin_title\u0026amp;th=1\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eEVA Clay foam (Optional but recommended)\u003c/p\u003e\n\u003cp\u003ehttps://www.michaels.com/product/modeling-foam-by-make-market-10625195\u003c/p\u003e\n\u003cp\u003eRubber Cement \u003ca href=\"https://www.walmart.com/ip/Gorilla-4-Ounce-Crystal-Clear-Rubber-Cement-Bottle-with-Brush-Applicator-Model-105779-1-Pack/105406946?wl13=1885\u0026amp;selectedSellerId=0\u0026amp;wmlspartner=wlpa\"\u003ehttps://www.walmart.com/ip/Gorilla-4-Ounce-Crystal-Clear-Rubber-Cement-Bottle-with-Brush-Applicator-Model-105779-1-Pack/105406946?wl13=1885\u0026amp;selectedSellerId=0\u0026amp;wmlspartner=wlpa\u003c/a\u003e (or similar)\u003c/p\u003e\n\u003cp\u003e1x Can of Plastidip https://www.lowes.com/pd/Plasti-Dip-11-fl-oz-Gray-Aerosol-Spray-Rubberized-Coating/50107784\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","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        \u003ch2\u003eREQUIRED TOOLS\u003c/h2\u003e\n\u003cp\u003eHeat gun\u003c/p\u003e\n\u003cp\u003eDremel\u003c/p\u003e\n\u003cp\u003eBox cutter\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\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        \u003ch2\u003eBUILD INSTRUCTIONS\u003c/h2\u003e\n\u003ch3\u003e3D printed parts\u003c/h3\u003e\n\u003col\u003e\n\u003cli\u003eStarting with the LED 3D printed parts, insert the square bar into the cutout in the circle until the end is flush with the face of the circle. glue these parts together and let the glue cure.\u003c/li\u003e\n\u003cli\u003eOnce the collar is either printed in a color that you like or is painted and ready for use, glue the crystal in place on top of it. It can only be placed in the collar one way.\u0026nbsp;\u003c/li\u003e\n\u003cli\u003eSame as the collar, print the button holder in a filament you like, or paint it before assembly.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch3\u003eSTART (PVC PIPE)\u003c/h3\u003e\n\u003cp\u003eThe length of the PVC pipe will determine how long the scepter / staff is, plus the additional height of the crystal and collar. I left my PVC pipe at 5ft.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eUse the heat gun to slowly add curves to the PVC pipe to give it a more natural look. Do not curve the pipe too much, as it may kink the pipe.\u003c/p\u003e\n\u003cp\u003eOnce you are happy with the shape, lay out the EVA foam and see how much you will need to cover the pipe. Make sure to leave a portion of the both ends uncovered so that the cap and crystal / collar will still fit over the pipe.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eUse the rubber cement on the PVC pipe and EVA foam. glue the EVA foam to the pipe.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eIf you are trying to add a wooden texture to the handle, use either a box cutter or a dremel. If you use a box cutter, simple curved slices + the heat gun will open up the cuts and give it a more textured look.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eIf there are gaps in the EVA foam, use EVA clay foam and sandpaper to hide them.\u003c/p\u003e\n\u003ch3\u003ePAINTING THE STAFF\u003c/h3\u003e\n\u003cp\u003eOnce you are happy with the texture of the staff, prep it for paint by hanging it in a place with good ventilation.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eCover the entirety of the staff (minus the exposed PVC pipe ends) with plastidip. Multiple layers are recommended. This will make the finish more durable and much easier to paint.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eThere are various paints that are acceptable for the staff. I would not recommend water based acrylic due to your hand potentially rubbing it off with sweat.\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","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eWIRING\u003c/h2\u003e\n\u003cp\u003eOnce the 3D printed LED parts are glued together, solder the 3 wires onto the LED and glue the LED strip to the square bar that was glued in place. Cut to length.\u003c/p\u003e\n\u003cp\u003eGlue the LED circle / bar assembly to the top of the staff on the inside of the PVC Pipe\u003c/p\u003e\n\u003cp\u003eNote: I used 19 LEDs. You can use more or less, but the value will need to be changed in the code. it is under section RP2040 BOARD NEOPIXEL POWER, line 53.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\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/002/109/original/LED_Glued.jpg?1766780356","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eFind a location suitable for the button holder printed earlier, and cut out the EVA foam in the way. Then drill out two holes and dremel away the remaining PVC pipe so that the button holder sits flush against the foam.\u003c/p\u003e\n\u003cp\u003eDo not glue in place yet!\u003c/p\u003e\n\u003cp\u003eSolder the wires onto the buttons as shown (do not solder anything to the RP2040 yet)\u003c/p\u003e\n\u003cp\u003eglue the buttons into their respective slots in the button holder\u003c/p\u003e\n\u003cp\u003eRun the button wires and LED wires down the length of the PVC pipe, ideally about 6-12\" of extra wire at the bottom.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eSolder the RP2040 PropMaker as shown in the diagram below. Tape in place on the battery / pi holder printed earlier. Place the battery in the holder with the Pi.\u003c/p\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/108/original/Staff_Wiring.jpg?1766765253","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/111/original/Staff_Battery_-_Pi_Holder.jpg?1766780491","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eASSEMBLY\u003c/h2\u003e\n\u003cp\u003eSlide the collar / crystal assembly over top the LEDs\u003c/p\u003e\n\u003cp\u003eInsert the battery / Pi holder assembly into the bottom of the staff, into the PVC.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eNote: It is a VERY tight fit. you may need to push the PropMaker over to clear the battery connector.\u003c/p\u003e\n\u003ch2\u003e\u0026nbsp;\u003c/h2\u003e\n\u003ch2\u003eCODE\u003c/h2\u003e\n\u003cp\u003eAfter installing Circuit Python on the RP2040 Propmaker, copy and paste this code into the code.py file. I use Mu Editor as it is what Adafruit recommends.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eSome libraries will need to be installed. Read through the IMPORTING LIBRARIES section of the code to see what you will need.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://learn.adafruit.com/debouncer-library-python-circuitpython-buttons-sensors/basic-debouncing\"\u003ehttps://learn.adafruit.com/debouncer-library-python-circuitpython-buttons-sensors/basic-debouncing\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003ehttps://docs.circuitpython.org/projects/simpleio/en/latest/\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries\n# SPDX-License-Identifier: MIT\n\n\"\"\"\n************************************************************\n                    IMPORTING LIBRARIES\n************************************************************\n\"\"\"\nimport os\nimport board\nimport neopixel\nimport time\nfrom adafruit_debouncer import Button\nfrom digitalio import DigitalInOut, Direction, Pull\nimport simpleio\n\n#Import all Adafruit LED Animations\nfrom adafruit_led_animation.helper import PixelSubset\nfrom adafruit_led_animation.animation.solid import Solid\nfrom adafruit_led_animation.animation.blink import Blink\nfrom adafruit_led_animation.animation.comet import Comet\nfrom adafruit_led_animation.animation.rainbowcomet import RainbowComet\nfrom adafruit_led_animation.animation.rainbow import Rainbow\nfrom adafruit_led_animation.animation.sparklepulse import SparklePulse\nfrom adafruit_led_animation.animation.pulse import Pulse\nfrom adafruit_led_animation.color import PURPLE, AMBER, JADE, RED, CYAN, BLUE, TEAL, ORANGE, YELLOW, AQUA, GREEN, MAGENTA, PINK, GOLD, WHITE\n\"\"\"\n************************************************************\n                    ESTABLISH COLORS\n************************************************************\n\"\"\"\n#Import Adafruit predetermined colors\n\n\nCOLORS = [RED, YELLOW, AMBER, ORANGE, GREEN, JADE, TEAL, AQUA, CYAN, BLUE, PURPLE, MAGENTA, PINK, GOLD, WHITE]\nG1_COLOR = 0\nG2_COLOR = 1\n\n\"\"\"\n************************************************************\n                    RP2040 BOARD NEOPIXEL POWER\n************************************************************\n\"\"\"\n# enable external power pin\n# provides power to the external components\nexternal_power = DigitalInOut(board.EXTERNAL_POWER)\nexternal_power.direction = Direction.OUTPUT\nexternal_power.value = True\n\n# Set pin for external neopixels\npixel_pin = board.EXTERNAL_NEOPIXELS\n# Set number of pixels on the strip\npixel_num = 19\npixel_brightness = 0.5\npixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=pixel_brightness, auto_write=True)\n\n\n# external button\npin = DigitalInOut(board.EXTERNAL_BUTTON)\npin.direction = Direction.INPUT\npin.pull = Pull.UP\nswitch = Button(pin, long_duration_ms = 1000)\nswitch_state = False\n\"\"\"\n************************************************************\n                    LED GROUPS\n************************************************************\n\"\"\"\nG1 = PixelSubset(pixels, 0, 9)\nG2 = PixelSubset(pixels, 9, 19)\n\"\"\"\n**********************************************************************************************************************\n                                                    PROGRAM START\n**********************************************************************************************************************\n\"\"\"\nMODE = 0\nSTARTUP = 0\n\nwhile True:\n# Initialize all animations once in the beginning\n    if STARTUP == 0:\n\n        solid = Solid(pixels, color=COLORS[G1_COLOR])\n        Comet1 = Comet(G1, speed=0.05, color=COLORS[G1_COLOR], tail_length=18, bounce=True)\n        Comet2 = Comet(G2, speed=0.07, color=COLORS[G2_COLOR], tail_length=18, bounce=True)\n        sparkle = SparklePulse(pixels, speed=0.08, period = 0.02, color=COLORS[G1_COLOR])\n        pulse = Pulse(pixels, speed=0.01, color=COLORS[G1_COLOR], period=3)\n        Dpulse1 = Pulse(G1, speed=0.01, color=COLORS[G1_COLOR], period=3.2)\n        Dpulse2 = Pulse(G2, speed=0.01, color=COLORS[G2_COLOR], period=5.4)\n        rainbow = Rainbow(pixels, speed=0.1, period=2)\n        rainbow_comet = RainbowComet(pixels, speed=0.08, tail_length=30, bounce=True)\n\n        STARTUP = 1\n\n    switch.update()\n# -----------SOLID MODE-----------------\n    if MODE == 0:\n        print(MODE)\n        solid.animate()\n\n        if switch.short_count == 1:\n            MODE = 1\n        elif switch.long_press:\n            MODE = 10\n\n# -----------COMET MODE--------------------\n    elif MODE == 1:\n        print(STARTUP)\n        Comet1.animate()\n        Comet2.animate()\n\n        #Switch to next mode\n        if switch.short_count == 1:\n            MODE = 2\n        elif switch.long_press:\n            MODE = 10\n\n# -----------SPARKLE MODE-----------------\n    elif MODE == 2:\n        print(MODE)\n        sparkle.animate()\n\n        if switch.short_count == 1:\n            MODE = 3\n        elif switch.long_press:\n            MODE = 10\n\n# -----------PULSE MODE-------------------\n    elif MODE == 3:\n        print(MODE)\n        pulse.animate()\n\n        if switch.short_count == 1:\n            MODE = 4\n        elif switch.long_press:\n            MODE = 10\n# -----------DUAL PULSE MODE--------------\n    elif MODE == 4:\n        print(MODE)\n        Dpulse1.animate()\n        Dpulse2.animate()\n\n        if switch.short_count == 1:\n            MODE = 5\n        elif switch.long_press:\n            MODE = 10\n# -----------RAINBOW MODE-----------------\n    elif MODE == 5:\n        print(MODE)\n        rainbow.animate()\n\n        if switch.short_count == 1:\n            MODE = 6\n        elif switch.long_press:\n            MODE = 10\n# -----------RAINBOW COMET MODE-----------\n    elif MODE == 6:\n        print(MODE)\n        rainbow_comet.animate()\n\n        if switch.short_count == 1:\n            MODE = 0\n        elif switch.long_press:\n            MODE = 10\n\n    #Switch to Color Changing Mode\n    elif MODE == 10:\n        #print(MODE)\n        if switch.short_count == 1:\n            G1_COLOR = (G1_COLOR + 1) % 15\n            G1.fill(COLORS[G1_COLOR])\n            pixels.show()\n            print(G1_COLOR)\n            STARTUP = 0\n        elif switch.short_count == 2:\n            MODE = 11\n        elif switch.long_press:\n            pixels.show()\n            MODE = 0\n\n    elif MODE == 11:\n        if switch.short_count == 1:\n            G2_COLOR = (G2_COLOR + 1) % 15\n            G2.fill(COLORS[G2_COLOR])\n            pixels.show()\n            print(G1_COLOR)\n            STARTUP = 0\n        elif switch.short_count == 2:\n            MODE = 10\n        elif switch.long_press:\n            pixels.show()\n            MODE = 0","metadata":{"language":"python","linenums":false,"filename":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eCOMPLETED BUILD / FUNCTIONALITY\u003c/h2\u003e\n\u003cp\u003eOnce everything is wired together, the staff should have the following functionalities\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eSPDT switch turns the staff on and off.\u003c/li\u003e\n\u003cli\u003eTactile button has multiple functions\n\u003col\u003e\n\u003cli\u003esingle short press will cycle between the 6 different modes\u003c/li\u003e\n\u003cli\u003esingle long press will switch to color selection mode for the primary color.\n\u003col\u003e\n\u003cli\u003eWhile in color selection mode, double pressing the tactile button will switch to color selection mode for the secondary color.\u0026nbsp;\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/li\u003e\n\u003cli\u003esingle long press while in color selection mode will return to the 6 different modes, starting from the beginning.\u0026nbsp;\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eThank you for taking the time to check this out, and if you built it, even better!\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}}]