The AdafruitMCP2221A breakout is a handy little board for adding peripherals to a computer via USB. It provides UART, similar to a standard USB to serial interface, and adds GPIO, ADC, DAC, and I2C. This means you can use your computer to directly read sensors or control devices directly, without using a microcontroller.
Adafruit has added support for the MCP2221A to the CPython port of CircuitPython (Blinka). This means that you get a nice Python interface to work with all sorts of fun stuff.
The aliases in this gist reflect some settings that are needed in my MacOS setup to work with the MCP2221A breakout. I am using the now-default zsh, supplemented by the excellent Oh My Zsh, so I put this file in OMZ's
custom location, $ZSH_CUSTOM
.
For more information on the breakout, and getting it set up with Windows, MacOS, and Linux, check out the Adafruit MCP2221A guide.
Alias | Command | Notes |
---|---|---|
mcp |
start MCP2221A session | Fire up the Python under the Blinka virtualenv with MCP2221A support turned on |
blinka |
start Blinka session | Fire up the Python under the Blinka virtualenv |
blinka_enable |
enable Blinka virtualenv | I installed Aadfruit Blinka in it's own Python virtualenv, which I manage with pyenv |
blinka_disable |
disable Blinka virtualenv | |
mcp_on |
check MCP2221A status | For CircuitPython to work with the MCP2221A, an environment variable must be set. Return the current state |
mcp_enable |
enable MCP2221A support | |
mcp_enable |
disable MCP2221A support |