Feb 2, 2023, 12:00PM to 1:50PM
You will need a laptop for today (one per pair). Please try to install the free mu editor (or equivalent tools) in advance for working with CircuitPython microcontrollers.
Materials for Today
- Bluefruit installed on Crickit
- 5V 3A power adapter
- micro-USB cable for your laptop
- your personal laptop
- DC motor pump(s) with leads attached
- small flat screwdriver
Circuit Playground Bluefruit Microcontroller
The motorized elements of our kinetic creations will be controlled using a microcontroller to measure sensors, operate actuators, and perform scripted actions. Today’s objective is to help you get started with the tools.
We will generally be following the hardware notes and sample code from the course technical guide. But we’ll go step by step at a novice level so no one gets left behind.
The link to the guide can always be found under SOFTWARE AND MECHANISM RESOURCES in the left-hand navigation bar of the course website.
If you have not already installed the mu Python editor, please also download that now and run the installer.
We first want to give you a quick preview of the end goal for the day.
- pump sequence demo
- mu editor
- editing/running code
- interacting directly with the Python system
- attaching a motor pump to the Crickit
Setting Up Your Hardware
- connecting the board
- testing using mu ‘Serial’, the read-eval-print loop (REPL) window
- testing the library
from adafruit_circuitplayground import cp
cp.red_led = True
- trying out sample code
The Crickit baseboard include motor drivers, hobby servo ports, and additional capacitive touch sensors. For today, we will use the sequence_motor.py sample code as a starting point.
- Connecting a motor and running the sample code.
- Changing timing and pattern.
CircuitPython lets you treat the microcontroller like a tiny data drive. Your code can be edited in-place, and saving will run it. But you’ll need to work out a plan for copying final programs back to your computer for your documentation.
- editing code in place
- saving programs back to your computer
- exploring the Adafruit tutorials
- exploring the library documentation