LED Reactive Light-Up Hockey Puck in MakeCode
2021-02-02 | By Adafruit Industries
License: See Original Project 3D Printing
Courtesy of Adafruit
Guide by Ruiz Brothers
Overview
In this project, we’re making a 3D printed LED hockey puck.
This was inspired by the DIY indoor hockey project by Yuksel Timez.
This hockey puck lights up and makes chips tunes based on motion!
You get a light show each time you hit the hockey puck, so it's still super fun even when you miss a goal.
Either the Circuit Playground Express or the Circuit Playground Bluefruit make this a fun and easy project that uses the built-in motion sensor and NeoPixel LEDs.
The case was 3D printed in NinjaFlex filament which lets you use the buttons to switch between different animations.
With MakeCode for the Circuit Playground Express or MakeCode Maker, we were able to quickly make this demo.
MakeCode an easy to use block-based code editor that's great if you're just getting started.
Parts
Select either the Circuit Playground Express or the Circuit Playground Bluefruit.
- Circuit Playground Express
- Circuit Playground Bluefruit - Bluetooth Low Energy
- Adafruit Micro-Lipo Charger for LiPoly Batt with USB Type C Jack
- Lithium Ion Polymer Battery with Short Cable - 3.7V 420mAh
- Fully Reversible Pink/Purple USB A to micro B Cable - 1m long
- 4 x M3 x 12mm
- 1 x 7/8 Dowel
3D Printing
Parts List
STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material. Original design source may be downloaded using the links below.
- puck-cover.stl
- puck-btm.stl
- hockey-blade.stl
Slicing Parts
Hockey Blade
Slice the Blade part with settings for PETG material. The parts were sliced using CURA using the slice settings below.
PETG filament
230c extruder
0.2 layer height
30% gyroid infill
70c heated bed
Circuit Playground Puck Case
Slice the Case parts with settings for TPU 98a material. The parts were sliced using CURA using the slice settings below.
TPU 98a filament
230c extruder
0.2 layer height
30% gyroid infill
50c heated bed
MakeCode
MakeCode for Adafruit Boards
MakeCode is an easy-to-use block-based programming editor that runs in the Google Chrome web browser. It’s has an intuitive interface and features lots of examples and demos.
LED Hockey Puck Code
If you are using the Circuit Playground Express, which uses https://makecode.adafruit.com, click the button below.
Get the Hockey Puck Code for the Circuit Playground Express
If you are using the Circuit Playground Bluefruit, which uses https://maker.makecode.com/, click the button below.
Get the Hockey Puck Code for Circuit Playground Bluefruit
Pair Device and Upload
Once you have the MakeCode program open, click the edit button on the top right to open it in a new MakeCode project.
The code blocks and simulator will be ready to modify. Let's get the device paired with WebUSB.
- Click on the Gear icon, at the top right.
- Select Pair Device from the dropdown.
- For the Circuit Playground Express, click on CPlay Express and Connect. For the Circuit Playground Bluefruit, click your device and click Pair Device.
- Click the big blue Download button to upload the code.
MakeCode Blocks
on start
if true then
- while true do show animation (rainbow)
if button B is pressed then
while true do
- show animation (purple fireball) for 2ms
else if
- button A is pressed then
- stop all animations
- while button A is pressed do
- show animation (blue chase) for 5000 ms
on button A click
- stop all animations
- While button A was pressed do
- show animation (blue chase color) for 5000 ms
on face down
stop all animations
- run in parallel
- show animation (red orange color) for 5000 ms
- play melody (falling)
on 2g (step)
- play sound (pew pew)
- stop all animation
- show animation (sparkle)
on button A+B click
- reset
Assemble
Place Lipo Battery
Orient the battery so the wire connections are facing down.
Align Circuit Playground
The battery port aligns with the flaps on the case.
Attach screws
Align the flaps on both parts of the case and fasten four M3x12mm screws to each standoff.
Plug in Battery
Pull the lid flaps back to plug in and to disconnect the battery to the Circuit Playground.
To close the port opening, push the larger flap behind the shorter flap.
Charging the Battery
The battery connector can reach out of case and plug into a USB lipo charger to recharge the battery.
Hockey Blade
The hockey blade press fits into a 7/8 diameter dowel.
Use an M3 screw to further secure the blade.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum