Feb 24, 2022, 12:20PM to 2:10PM

Welcome! The main objectives for today are to introduce the Adafruit Circuit Playground Bluefruit microcontroller and CircuitPython programming. You will work in pairs for this learning activity today.

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.

Administrative

Next class we have a fantastic visiting speaker – Chico MacMurtrie – you are welcome to invite a friend to the talk at 1pm on Tues., Mar. 1.

Looking Ahead

  • Tuesday: visiting speaker (in-class, but remote presenter )
  • Thursday: costume integration, improvisatory kinetic sculpture
  • (Spring Break.)
  • (Start project, with interspersed topical workshops.)

Materials for Today

  • Bluefruit installed on Crickit
  • 5V 3A power adapter
  • micro-USB cable for your laptop
  • your personal laptop
  • DC motor pump
  • micro hobby servo
  • small flat screwdriver

Circuit Playground Bluefruit Microcontroller

The motorized elements of our kinetic creations will be controlled using a wearable 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.

Downloads

If you have not already installed the mu Python editor, please also download that now and run the installer.

Live Demo

We first want to give you a quick preview of the end goal for the day.

  1. touch-sensitive light demo
  2. mu editor
  3. editing/running code
  4. interacting directly with the Python system
  5. attaching a motor pump to the Crickit
  6. attaching a hobby servo to the Crickit

Setting Up Your Hardware

  1. connecting the board
  2. testing using mu ‘Serial’, the read-eval-print loop (REPL) window
    2+2
    3**201
    import time
    time.monotonic()
    help('modules')
  3. testing the library
    from adafruit_circuitplayground import cp
    cp.red_led = True
    cp.play_tone(440, 1.0)
  4. trying out sample code

Crickit

The Crickit baseboard include motor drivers, hobby servo ports, and additional capacitive touch sensors.

  1. Connecting a motor and running the sample code
  2. Connecting a hobby servo and running the sample code.

Next Steps

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.

  1. editing code in place
  2. saving programs back to your computer
  3. exploring the Adafruit tutorials
  4. exploring the library documentation

Assignment

Assignment 7