These example tutorials were written for the Bodies in Wearables Jam. This wearable jam will provide participants with the opportunity and support to apply the skills introduced through the Bodies in Wearable Workshop Series to develop a concept into a working wearable prototype.
All of the examples use an Adafruit Circuit Playground Express on the MakeCode platform. An overview of the Circuit Playground Express can be found here.
List of Tutorials
- Getting Started
- Basic LEDs
- Neopixels
- Sensors
- 180-Degree Servos
- 360-Degree Servos
- Servo Motor Mounts
Getting Started
Kit Materials
This custom kit contains the parts that are used in the following tutorials. A Bodies in Wearables Kit Shopping List for Online Participants can be found here.
- Adafruit Circuit Playground Express Base kit – includes battery pack, batteries, and USB cable
- Micro servo sg90
- Alligator to servo cable
- Neopixel Strip
- Fairy Lights, with battery pack cut off
- Short Alligator Clips
- 90deg 3D printed servo mount
- Multi-angle Flexible 3D printed servo mount
- 3D printed tabs
- 12″ of Thick (1.5″) Double-Sided Velcro
- 12″ of Thin (0.75″) Double-Sided Velcro
- Sand Paper
Circuit Playground Express (CPX) & MakeCode
The Circuit Playground Express is a microcontroller from Adafruit Industries. A microcontroller is a piece of hardware that allows us to interface with the real world around us using code. The CPX is a versatile and beginner friendly board. The board has a circular form factor and is good for a variety of uses.
The CPX can be programmed in different ways for the jam we will focus on MakeCode. MakeCode is a block-based editor that is perfect for the beginner programmer. You do not need any dedicated software to run MakeCode; it can run from any browser on a computer. Another advantage of MakeCode is that you can simulate your code on the browser before running it on the Circuit Playground Express.
The Circuit Playground has different power connection options;
- It can be connected using a micro USB cable connected to wall adapter or portable battery
- Lithium ion polymer rechargeable battery with JST connector
- Standard battery holder with JST connector
Basic LEDs
Blink On-Board LED
The Circuit Playground has two indicator LEDs located on each side of the USB slot. In this tutorial we shall be blinking the on-board LED all you need is a USB micro cable. Connect your CPX to your computer, download the MakeCode code and load it onto your CPX.
Link to code
Fairy Lights
There are many types of LEDs that you can connect to the CPX, but for wearables, fairy lights can be very easy to work with because they are low-cost and you can connect a whole string of lights with just two connections.
Preparing the fairy lights
First, snip the battery pack off of the fairy lights with small snips or scissors. Next, use sandpaper on the ends of the wires to remove the resin coating and expose the conductive metal.
Connecting to the CPX
To Connect your CPX to the fairy lights you will need the 2 alligator clips, a resistor, and a USB micro cable. Connect one alligator clip to the ground pin of the CPX and the other clip to the A2 pin. Connect the ground pin alligator clip to one end of the resistor and the other end to the fairy lights, then connect the A2 alligator clip to the other end of the fairly light. Load the code onto the CPX to light up the fairy lights.
Link to code
NeoPixels
The CPX has a ring of 10 multicolor RGB LEDs also called NeoPixels. They can light any color and be addressed individually.
Turning On Neopixels
To turn on the Neopixels, connect your CPX to your computer using a USB micro cable, download the code and load it onto your CPX.
Link to code
Neopixel strip
In this tutorial we shall connect the NeoPixel strip to the CPX. Start by connecting the red alligator clip to the VOUT pin, black to ground and white to the A1 pin then load the code onto the CPX.
Link to code
Servos
In this tutorial we look at various examples using two types of servo motors one is the 180 degree servo and the other is the continuous 360 degree servo. To connect the CPX to a servo you will need the alligator to servo cable, the black alligator wire connects to the brown servo wire, red wire connect to red and white connects to orange. Connect the black alligator clip to the ground pin, red to the 3.3V pin and white to the A2 pin, the load the code onto the CPX.
180 degree servos
Range Test
Link to code
Button-Activated Motion
Link to code
Looping
Link to code
Continuous 360 Degree Servos
Toggle Direction
Link to code
Sensors
In these examples the on board sensors are used to light up the CPX NeoPixels. It explores motion sensing using the onboard accelerometer and the sound sensor.