If you'd like your new glue stick archway to do more than just glow beautifully, you can use MakeCode to quickly incorporate some of Circuit Playground Express's many sensors.
For example, we can alter the original MakeCode so that the rainbow only comes on when the lights are dimmed. This code is available by opening the example below, or you can follow the steps on your own to make these changes.
First, grab an
if/else statement from the Logic block. Drag the previous code into this new
if/else statement and place that all back into the
light level into the
if true statement. The light level is measured from 0-255 and can be adjusted to suit whatever light conditions you're in, but
120 is a good starting place.
else section, drag in
strip clear from the NEOPIXEL block.
Voila! Your rainbow now responds to light and dark: by covering the light sensor on Circuit Playground Express with my hand, the rainbow is turned on.
If you have access to a laser cutter, some acrylic parts make a beautiful and much more robust platform than cardboard can.
Pick acrylic at least as thick as the NeoPixel strip you have so that the pixels can be sandwiched between two pieces.
Download the design file below and import into your laser's software.
NOTE: you may have to adjust the hole sizes depending on the brand of glue stick you have.
Tape each NeoPixel dot down.
Sandwich the NeoPixels between the bottom two plates. This will ensure they stay firmly in place.
If a rainbow archway doesn't suit your purposes, there are many other avenues of design that can be explored.
Other matrix layouts are worth exploring. Weaving glue sticks together may also produce a strange effect.
If you enjoy MakeCode and want to continue exploring you can check out lots more MakeCode projects on the Adafruit Learn System.