7

(avery) #1
FORGE

onto each cable tie, and secure tightly. Make sure you
are putting the eye onto the cable tie in the correct
orientation, or the eye will slide right off. You can look
at a fresh cable tie for reference. When your Circuit
Playground Express is secured in place, use angle
cutters to snip the end off each tie.


ATTACH THE NEOPIXEL STRIP
Now, let’s secure the NeoPixel strip to the bottom of
the bag, and give it some protection at the same time.
Place the strip on the bottom of your bag, close to the
side that the Circuit Playground Express is mounted
to. Ensure that the wires flow neatly next to the strip
and up the middle of the front of the bag to the Circuit
Playground Express. These will be visible, so make
them as tidy as possible.
Cover the NeoPixel strip with a strip of clear,
heavy-duty packing tape or clear Gorilla tape. Press
the tape down well on all sides of the strip and be
sure to press out any air bubbles. The clear tape
disappears almost completely when the lights are
on. Use another piece of the clear tape to cover the
wires running up the front of the bag, and keep them
from getting jumbled up and snagged on things inside
your bag.


INSTALL THE BATTERY PACK
It’s time to add the battery holder! The battery holder
will live inside the bag, and the Circuit Playground
Express is mounted to the outside, so we’ll need
to cut one more hole in the front of the bag for the
battery holder’s wires to pass through. Using a craft
knife, cut a slit about 1 cm long below the CPX’s JST
port. With the battery pack on the inside of the bag,
push its JST plug through the slit, to the front of the
bag. Depending on the thickness of your plastic,
this could be tricky, and you may need to cut a fully
fledged hole to get it through.
Insert batteries into the holder, and plug the JST
connector into the port on the Circuit Playground
Express. Use the on/off switch on the battery holder
to turn your circuit back on and off.


Below
The LED strip fits
unobtrusively in the
bottom of the clutch

Left
The NeoPixels are
really simple to
wire. There’s just
power and one
data connection
Below
The battery should
push into the
JST socket

Now let’s make everything light up with code!
This code is a little more complex than our previous
projects, but by the end you’ll know how to extend
the abilities of your Circuit Playground Express by
adding external outputs, like NeoPixel strips, to pins.
To get started, connect the CPX to your computer
with a micro USB cable. Then open your browser
and navigate to makecode.adafruit.com, and start a
new project.

SET UP
We won’t be using the Forever loop in this program, so
delete it from the workspace. However, we will need
to set some actions to happen at the beginning of the
program, so open the Loops menu and drag an On
Start loop onto the workspace.
The light sensor and built-in LEDs are set up by
default in MakeCode, but we need to create a new
variable for our NeoPixel strip so we can work with
it in our program. Go into the Variables menu, click
‘Make a Variable’ and name it ‘strip’. You’ll now
see that a few new items have appeared in the
Free download pdf