But first...
To use Circuit Playground Express and CRICKIT together, you'll first need to install the special 'seesaw' version of the CPX firmware. This guide will take you through how to install CRICKIT support onto your circuit playground express.
Adafruit recommends the Mu editor to easily craft and load your code to your CircuitPython projects. You can learn more about Mu by reading this guide.
Once you have completed these steps, you're ready to move on.
Get Ready!
- Connect the MicroUSB for coding from the Circuit Playground Express to your computer
- Put 3 AA batteries in a battery pack and connect to the Crickit, or use a wall adapter
- Turn on the Crickit, check that the switch next to the DC power plug is ON
Connect Motor
Now it's time to test the code and make sure the DC motor runs.
First, connect your motor to the CRICKIT as pictured, using a small screwdriver to tighten down the screws.
Copy and paste the code below into your Mu editor.
Save this code to your CIRCUITPY drive as code.py
# SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
from adafruit_crickit import crickit
# Create one motor on seesaw motor port #1
motor = crickit.dc_motor_1
motor.throttle = 0.5 # half speed forward
# Create drive (PWM) object for the lights on Drive 1
lights = crickit.drive_1
lights.frequency = 1000 # Our default frequency is 1KHz
while True:
lights.fraction = 0.5 # half on
time.sleep(0.8)
lights.fraction = 0.2 # dim
time.sleep(0.1)
# and repeat!
Troubleshooting
Problem: My motor still won't spin!
Solution: Check that you have a 5V power supply attached to the DC jack on your CRICKIT board.
Problem: My Circuit Playground Express isn't recognized by Mu!
Solution: Make sure your board is set up as a CIRCUITPY device. If it is showing up at "CPLAYBOOT" on your computer, you can follow the steps in this guide to get it back into CIRCUITPY mode.
Page last edited January 20, 2025
Text editor powered by tinymce.