# CircuitPython Libraries on any Computer with FT232H

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/081/621/medium800/sensors_banner.jpg?1569634959)

This guide will show you how to use an FT232H to connect to I2C and SPI sensors and breakouts from your desktop PC running Windows, Mac OSX, or Linux. The FT232H also allows for general purpose digital input and output (GPIO) for things like buttons and LEDs.

The cool part about this is that you can then use any of the CircuitPython Libraries that have been written for the numerous sensors and breakouts.

## CircuitPython and CircuitPython Libraries

As you are going through this guide, keep in mind the difference between CircuitPython and CircuitPython Libraries:

- **CircuitPython** - a microprocessor specific implementation of Python written in C. [Here's the source code](https://github.com/adafruit/circuitpython). And here's the [main CircuitPython guide](https://learn.adafruit.com/welcome-to-circuitpython).
- **CircuitPython Libraries** - sensor and breakout specific code written in Python using the CircuitPython hardware API. There are a lot of these - [check out the bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

There are various hardware combinations that allow for running CircuitPython and CircuitPython Libraries. In this guide we will **not** be using the actual CircuitPython firmware. But we will be using CircuitPython Libraries. To explain this further, let's go over the main hardware platforms and explain where the FT232H fits in to all this.

## CircuitPython on Microcontrollers

This is the most straight forward setup.

If you are using a [microcontroller](https://circuitpython.org/downloads) that can run CircuitPython, then you will most likely have the low level hardware interfaces needed to access the many sensors and other breakout boards - I2C, SPI, and GPIO. Even better, there is most likely a CircuitPython library written for the sensor.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/365/medium800/sensors_board_mcu.png?1569354970)

In this case, you simply [install CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython), add the [libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries), and then follow whatever [guide](https://learn.adafruit.com/) goes along with your sensor.

## CircuitPython on Single Board Computers

This setup requires a special shim library called [Blinka](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/overview).

Single Board Computers (SBC), like the Raspberry Pi and Beagle, also typically have I2C, SPI, and GPIO interfaces available. These boards are also powerful enough to run complete operating systems, like Linux. They can't run CircuitPython directly, but generally don't need to. They can run the much larger Python implementations, like CPython. To allow use of SBCs running Python to use CircuitPython libraries to access sensors over I2C/SPI/GPIO, the [Blinka](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/overview) library was created.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/366/medium800/sensors_board_sbc.png?1569354982)

In this case, you pip install [Blinka](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/overview), pip install [libraries](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi), and then follow whatever [guide](https://learn.adafruit.com/) goes along with your sensor.

## CircuitPython on Personal Computers

This is where the FT232H comes in. Here's why.

So what about your super powerful desktop or laptop PC? They can most definitely run Python. But can they also use CircuitPython libraries and talk to I2C/SPI sensors? Can they blink LEDs? Read buttons? Generally, no. As powerful as your Windows, Mac, or Linux PC is, it most likely does not have those low level hardware interfaces. Look on the back of your computer. Do you see an I2C port? A SPI port? A cluster of pins labeled GPIO? Nope.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/367/medium800/sensors_board_pc.png?1569354992)

So what can we do? Well, look again at the back of your PC. See any USB ports? Most likely there are several. Heck, there are probably even several USB ports on the front of your PC! Can we use USB? Yes, thanks to a specialized USB bridge chip made by FTDI - the [FT232H](https://www.adafruit.com/product/2264).

This will allow us to do something like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/369/medium800/sensors_board_ft232h.png?1569355012)

With FT232H support added to Blinka, we can follow a similar approach as with the SBCs. The FT232H attached to the USB port acts as our surrogate set of low level hardware interfaces.

Neat! Let's see how we can get this all setup and working.

# CircuitPython Libraries on any Computer with FT232H

## Running CircuitPython Code without CircuitPython

There are two parts to the CircuitPython ecosystem:

- **CircuitPython firmware** , written in C and built to run on various microcontroller boards (not PCs). The firmware includes the CircuitPython interpreter, which reads and executes CircuitPython programs, and chip-specific code that controls the hardware peripherals on the microcontroller, including things like USB, I2C, SPI, GPIO pins, and all the rest of the hardware features the chip provides.
- **CircuitPython libraries,** written in Python to use the native (built into the firmware) modules provided by CircuitPython to control the microcontroller peripherals and interact with various breakout boards.

But suppose you'd like to use CircuitPython **libraries** on a board or computer that does not have a native CircuitPython **firmware** build. For example, on a PC running Windows or macOS. Can that be done? The answer is yes, via a separate piece of software called **Blinka**. Details about Blinka follow, however it is important to realize that the **CircuitPython firmware is never used**.

Info: 

# Adafruit Blinka: a CircuitPython Compatibility Library

Enter **Adafruit**  **Blinka**. Blinka is a software library that emulates the parts of CircuitPython that control hardware. Blinka provides non-CircuitPython implementations for `board`, `busio`, `digitalio`, and other native CircuitPython modules. You can then write Python code that looks like CircuitPython and uses CircuitPython libraries, without having CircuitPython underneath.

There are multiple ways to use Blinka:&nbsp;

- Linux based Single Board Computers, for example a Raspberry Pi
- Desktop Computers + specialized USB adapters
- Boards running MicroPython

More details on these options follow.

## Raspberry Pi and Other Single-Board Linux Computers

On a Raspberry Pi or other single-board Linux computer, you can use Blinka with the regular version of Python supplied with the Linux distribution. Blinka can control the hardware pins these boards provide.

## Desktop Computers&nbsp;

On Windows, macOS, or Linux desktop or laptop ("host") computers, you can use special USB adapter boards that that provide hardware pins you can control. These boards include [MCP221A](https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-mcp2221)&nbsp;and [FT232H](https://learn.adafruit.com/adafruit-ft232h-breakout) breakout boards, and [Raspberry Pi Pico boards running the **u2if** software](https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-raspberry-pi-pico). These boards connect via regular USB to your host computer, and let you do GPIO, I2C, SPI, and other hardware operations.

## MicroPython

You can also use Blinka with MicroPython, on [MicroPython-supported boards](https://learn.adafruit.com/circuitpython-libraries-on-micropython-using-the-raspberry-pi-pico). Blinka will allow you to import and use CircuitPython libraries in your MicroPython program, so you don't have to rewrite libraries into native MicroPython code. Fun fact - this is actually the original use case for Blinka.

# Installing Blinka

Installing Blinka on your particular platform is covered elsewhere in this guide. The process is different for each platform. Follow the guide section specific to your platform and make sure Blinka is properly installed before attempting to install any libraries.

Info: 

# Installing CircuitPython Libraries

Once Blinka is installed the next step is to install the CircuitPython libraries of interest. How this is down is different for each platform. Here are the details.

## Linux Single-Board Computers

On Linux single-board computers, such as Raspberry Pi, you'll use the Python `pip3`&nbsp;program (sometimes named just `pip`) to install a library. The library will be downloaded from [pypi.org](https://pypi.org) automatically by `pip3`.

How to install a particular library using `pip3` is covered in the guide page for that library. For example, [here is the `pip3` installation information](https://learn.adafruit.com/adafruit-lis3dh-triple-axis-accelerometer-breakout/python-circuitpython#python-installation-of-lis3dh-library-2997958) for the library for the LIS3DH accelerometer.

The library name you give to `pip3` is usually of the form `adafruit-circuitpython-libraryname`. This is not the name you use with `import`. For example, the LIS3DH sensor library is known by several names:

- The GitHub library repository is [Adafruit\_CircuitPython\_LIS3DH](https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH).
- When you import the library, you write `import adafruit_lis3dh`.
- The name you use with `pip3` is `adafruit-circuitpython-lis3dh`. This the name used on [pypi.org](https://pypi.org).

Libraries often depend on other libraries. When you install a library with `pip3`, it will automatically install other needed libraries.

## Desktop Computers using a USB Adapter

When you use a desktop computer with a USB adapter, like the MCP2221A, FT232H, or u2if firmware on an RP2040, you will also use pip3. However, **do _not_ install the library with `sudo pip3`** , as mentioned in some guides. Instead, just install with `pip3`.&nbsp;

## MicroPython

For MicroPython, you will not use `pip3`. Instead you can get the library from the CircuitPython bundles. See [this guide page](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries) for more information about the bundles, and also see the [Libraries page on circuitPython.org](https://circuitpython.org/libraries).

# CircuitPython Libraries on any Computer with FT232H

## Setup

The support for the FT232H in Blinka utilizes the [pyftdi library](https://pypi.org/project/pyftdi/) by [eblot](https://pypi.org/user/eblot/). This in turn relies on a few other things, like libusb. So before we can actually use the FT232H, we need to get everything setup. See the OS specific sections for what we went through to get things working for each.

## Additional Information

Just for reference, here's the install info from the pyftdi library itself:

[pyftdi Installation](https://github.com/eblot/pyftdi/blob/master/pyftdi/doc/installation.rst)
 **But first try the install instructions on the pages that follow for your OS.**

# CircuitPython Libraries on any Computer with FT232H

## Windows

Getting this all set up on Windows is not fun - but it is possible. Follow each step below to get it working on Windows

# Have Python 3 Installed

We assume you already have Python 3 installed on your computer. **Note we do not support Python 2** - it's deprecated and no longer supported!

At your command line prompt of choice, check your Python version with `python --version`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/603/medium800/sensors_image.png?1569630954)

# Plug in FT232H & Fix Driver with Zadig

Unlike Mac or Linux, Windows doesn't like devices that are 'driverless' - every hardware device must have a driver attached to it. To _fix_ the driver on Windows, we must use a tool called Zadig

Info: 

Download the appropriate Zadig tool&nbsp;for your version of Windows [at its homepage](http://zadig.akeo.ie/). &nbsp;This tool simplifies the installation of a libusb driver for the FT232H device.

**Before you run the tool unplug all FTDI devices from your computer. &nbsp;This includes devices like Arduinos which include an FTDI chip as a USB to serial converter. &nbsp;You want to unplug these devices to make sure you don't accidentally select one with the tool and replace its driver.**

After all the FTDI devices are unplugged, plug in your FT232H breakout to the computer so it is the only FTDI device connected to the computer.

Now run the Zadig tool executable you just downloaded (there is no installation necessary, the executable is the program). &nbsp;Click the **Options** menu and select the **List All Devices** item below:

![](https://cdn-learn.adafruit.com/assets/assets/000/088/615/medium800/sensors_zadig1.jpg?1582329332)

The list box of devices should populate with many devices. &nbsp;Select the USB Serial Converter device shown below.

**Note: Make sure to select the device with Driver equal to FTDIBUS and USB ID equal to 0403 6014! &nbsp;** If you pick the wrong device you might accidentally uninstall another device's driver and make it inoperable.

![](https://cdn-learn.adafruit.com/assets/assets/000/091/683/medium800/sensors_libusbK.png?1591059808)

Click the up/down arrows on the driver select box to the right of the green arrow and select the **libusbK** driver as shown above.

Now click the Replace Driver button to replace the FTDI driver with the libusbK-based driver. &nbsp;After the driver replacement finishes you can close Zadig tool.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/617/medium800/sensors_zadig4.jpg?1582329427)

To check that the driver was successfully replaced, open Device Manager from Control Panel or searching in the Start menu. &nbsp;You should see a new top level node **libusbK devices** and the **USB Serial Converter** underneath it as shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/091/684/medium800/sensors_devusbK.png?1591059833)

If you see the libusb-win32 node and USB serial device, move on to the next step to install libftdi.

If you don't see the libusb-win32 node, try unplugging and plugging back in the FT232H breakout. &nbsp;If you still don't see the node, run Zadig tool again and follow the steps above again to make sure you replace the FTDI driver for the device with the libusb-win32 driver.

# Option 1 - Install pyftdi and pyusb

As a first attempt, try simply pip installing pyftdi and pyusb.

`pip3 install pyusb`

`pip3 install pyftdi```

And then move to the **Test pyusb and pyftdi** section below. If the install runs into issues or doesn't seem to work, you may need to try **Option 2**. This is what it originally took to set things up on Windows. However, it has been reported that the latest version of pyusb "just works", so you might get lucky :)

# Option 2 - Install pyftdi and (fixed) pyusb

Next lets install pyusb and pyftdi. We have to do a little trickery here so before you start run

**pip3 uninstall pyusb**

**pip3 uninstall pyftdi**

(or pip instead of pip3 if that's how you have it named)

To make sure you do _not_ have pyusb and pyftdi installed

![](https://cdn-learn.adafruit.com/assets/assets/000/081/607/medium800/sensors_image.png?1569631736)

Run them again to make absolutely sure!

![](https://cdn-learn.adafruit.com/assets/assets/000/081/608/medium800/sensors_image.png?1569631756)

We need to get a fork of pyusb to fix a bug that affects windows:

`git clone https://github.com/minkustree/pyusb.git`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/609/medium800/sensors_image.png?1569631892)

Then

`cd pyusb`

`python setup.py install`

if you get a permission denied error, try

`python setup.py install --user`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/610/medium800/sensors_image.png?1569631950)

 **Now** you can run `pip install pyftdi`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/611/medium800/sensors_image.png?1569632009)

# Test pyusb and pyftdi

Now that you have pyusb and pyftdi installed correctly, run python and paste in the following (with the FT232H plugged in)

`import usb`  
`import usb.util`  
`dev = usb.core.find(idVendor=0x0403, idProduct=0x6014)`  
`print(dev)`

You should get something like the following, not that `dev` is `None` or any other weird failure

![](https://cdn-learn.adafruit.com/assets/assets/000/081/612/medium800/sensors_image.png?1569632067)

If you get `usb.core.NoBackendError: No backend available`

![](https://cdn-learn.adafruit.com/assets/assets/000/091/682/medium800/sensors_image.png?1591058877)

[Download libusb 1.0.23](https://sourceforge.net/projects/libusb/), uncompress it with WinRar or some other decompression tool that can open 7z files.

If you are on 64-bit Windows, copy the `MS64\dll\libusb-1.0.dll` file into `C:\Windows\System32` and `C:\Windows\SysWOW64I`

If you are on 32-bit Windows, copy the `MS32\dll\libusb-1.0.dll` file into `C:\Windows\System32`

# Install Adafruit Blinka

Run `pip install adafruit-blinka`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/624/medium800/sensors_image.png?1569796546)

# Set Environment Variable

You must do this every time before running circuitpython code, you can set it permanently in windows if you like, for now just type into the same cmd window you're using with Python

`set BLINKA_FT232H=1`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/625/medium800/sensors_image.png?1569796619)

If you are using Windows Powershell, the syntax is a little different. In that case do:

`$env:BLINKA_FT232H=1`

Info: 

# Check Platform was detected

In the same command window you `set BLINKA_FT232H=1` env var, run `python` and run

`import boarddir(board)```

at the Python REPL. If you get no errors, and you see a list of all the pins available - you're good to go!

![](https://cdn-learn.adafruit.com/assets/assets/000/081/629/medium800/sensors_image.png?1569797036)

# CircuitPython Libraries on any Computer with FT232H

## Mac OSX

We assume you already have Python 3 and brew available on your Mac. Thankfully, setup on MacOS X is not so bad!

Note: If you are running VMWare Fusion on MacOS, then you can also try the [Windows install](https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h/windows) process.

# Install libusb

Start by installing libusb with

`brew install libusb`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/630/medium800/sensors_screenshot_03.png?1569799248)

# Install pyftdi and Blinka

Then, `pip3 install pyftdi` which will also install some other libraries

![](https://cdn-learn.adafruit.com/assets/assets/000/081/631/medium800/sensors_screenshot_04.png?1569799249)

Then `pip3 install adafruit-blinka`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/632/medium800/sensors_screenshot_05.png?1569799251)

# Test!

Finally, set the environment variable with

`export BLINKA_FT232H=1`

and run python3. In the REPL, type

`import board`  
`dir(board)`

You should get no errors, and a list of the pins available

![](https://cdn-learn.adafruit.com/assets/assets/000/081/635/medium800/sensors_screenshot_08.png?1569799445)

# CircuitPython Libraries on any Computer with FT232H

## Linux

The following shows a typical run through installing and setting things up on Linux.

## Install libusb

Run the following:

```auto
sudo apt-get install libusb-1.0
```

and answer **Y** to the prompt. This should install libusb.

## Setup udev rules

Use a text editor to create and edit the file **/etc/udev/rules.d/11-ftdi.rules** and add the following contents.

```auto
# /etc/udev/rules.d/11-ftdi.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", GROUP="plugdev", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6011", GROUP="plugdev", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", GROUP="plugdev", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6014", GROUP="plugdev", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6015", GROUP="plugdev", MODE="0666"
```

Here we use nano, so run:

```auto
sudo nano /etc/udev/rules.d/11-ftdi.rules
```

like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/387/medium800/sensors_Screenshot_from_2019-09-24_16-49-08.png?1569369001)

add the contents from above:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/388/medium800/sensors_Screenshot_from_2019-09-24_16-50-19.png?1569369048)

and then press **CTRL-X** and **Y** to save and exit.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/389/medium800/sensors_Screenshot_from_2019-09-24_16-51-36.png?1569369109)

 **The settings will take effect the next time you plug in the FT232H.**

Info: 

## Install pyftdi

To install pyftdi and its dependencies, run:

```auto
pip3 install pyftdi
```

![](https://cdn-learn.adafruit.com/assets/assets/000/081/386/medium800/sensors_Screenshot_from_2019-09-24_16-34-22.png?1569368082)

## Install Blinka

To install Blinka and its dependencies, run:

```auto
pip3 install adafruit-blinka
```

![](https://cdn-learn.adafruit.com/assets/assets/000/081/402/medium800/sensors_pip.png?1569424293)

## Set environment variable

We need to manually signal to Blinka that we have a FT232H attached. To do this, we set the environment variable **BLINKA\_FT232H**. The value doesn't matter, just use 1:

```auto
export BLINKA_FT232H=1
```

![](https://cdn-learn.adafruit.com/assets/assets/000/081/390/medium800/sensors_Screenshot_from_2019-09-24_17-05-53.png?1569370234)

Danger: 

## Run the sanity check.

Now move on to the Sanity Check section and run the commands there to make sure everything is installed correctly.

# CircuitPython Libraries on any Computer with FT232H

## Post Install Checks

After going through all the install steps for your OS, run this as a simple test to make sure everything is installed correctly. See the rest of the page for some potential hiccups you may run into.

Go ahead and plug in your FT232H to a USB port on your PC.

# Check pyftdi is installed correctly

Launch Python:

```auto
python3
```

and enter these commands:

```auto
from pyftdi.ftdi import Ftdi
Ftdi().open_from_url('ftdi:///?')
```

You should get a list of connected FTDI devices. Most likely, there will be only one.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/372/medium800/sensors_Screenshot_from_2019-09-24_13-59-50.png?1569358803)

If an FTDI device can not be found for some reason, you'll see something like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/371/medium800/sensors_Screenshot_from_2019-09-24_13-58-40.png?1569358741)

If you get

`NotImplementedError: Operation not supported or unimplemented on this platform`

Go back to the setup steps and Zadig your board if on Windows

# Check environment variable within python

At the Python REPL, type

`import os`  
`os.environ["BLINKA_FT232H"]`

if you get a KeyError it means you did not set the environment variable right

![](https://cdn-learn.adafruit.com/assets/assets/000/081/615/medium800/sensors_image.png?1569633945)

If you see some other errors, go back through the install process for your OS and make sure everything ran correctly.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/616/medium800/sensors_image.png?1569634052)

If you have set it correctly, you'll get a value back

Now type in `import board`

![](https://cdn-learn.adafruit.com/assets/assets/000/081/617/medium800/sensors_image.png?1569634165)

You should get no errors at all, in which case you can continue onto the next steps!

# Board not supported None

If you get

`NotImplementedError: Board not supported None`

that could mean you did not set the FT232H environmental variable _or_ you don't have the latest python libraries _or_ the FT232H is not plugged in.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/613/medium800/sensors_image.png?1569633745)

# BLINKA\_FT232H environment variable set, but no FT232H device found

If you get this error, check your USB cable - it could be that you have a charge-only not charge+sync cable.

If you're running Windows, verify you ran Zadig to install the libusbK driver

![](https://cdn-learn.adafruit.com/assets/assets/000/081/626/medium800/sensors_image.png?1569796758)

# The device has no langid
On Windows, if you get&nbsp;`ValueError: The device has no langid` on an open\_from\_url() call that may mean you dont have **libusbk.dll** placed in **C:\Windows\System32**

![](https://cdn-learn.adafruit.com/assets/assets/000/081/618/medium800/sensors_image.png?1569634426)

# NotImplementedError: Operation not supported or unimplemented on this platform

If you're running Windows, run Zadig to select/install the libusbK driver on this device

![](https://cdn-learn.adafruit.com/assets/assets/000/081/627/medium800/sensors_image.png?1569796904)

# pyftdi.ftdi.FtdiError: UsbError: [Errno 13] Access denied (insufficient permissions)

If you get this on a Mac, it could be you have conflicting ftdi drivers installed, you'll need to remove them!

## Versions of OS X up to and including 10.8

The easiest way we found to do that is run

`brew remove libftdi`

This may have been installed by `avrdude`, `open-ocd` or other tools! You may have to --force uninstall it depending on what tools you are using.

For OS X versions 10.3 to 10.8, there is a procedure outlined in section 4.1 of Application Note AN 134 from FTDI:

[AN 134 FTDI Drivers Installation guide for MAC OS X](http://www.ftdichip.com/Support/Documents/AppNotes/AN_134_FTDI_Drivers_Installation_Guide_for_MAC_OSX.pdf)
In summary, start a terminal session:

**Go -\> Applications -\> Utilities -\> Terminal**

and run the following commands:

```terminal
cd /System/Library/Extensions
sudo rm -r FTDIUSBSerialDriver.kext
cd /Library/Receipts
sudo rm -r ftdiusbserialdriver.pkg
sudo rm -r ftdiusbserialdriverinstallerPostflight.pkg
sudo rm -r ftdiusbserialdriverinstallerPreflight.pkg
```

and then reboot the system for the changes to take effect.

## Versions of OS X 10.9 through 10.13
For OS X versions 10.9 though 10.13, you can unload the kext driver by running the following command:

```terminal
sudo kextunload -v -bundle com.apple.driver.AppleUSBFTDI
```

Please note, the system will automatically reload the kext driver upon restart, so this would need to be run each time before using the board.

You may want to use an alias or script to easily run this command.

[PyFtdi Troubleshooting Guide](https://eblot.github.io/pyftdi/troubleshooting.html#error-access-denied-insufficient-permissions)
# CircuitPython Libraries on any Computer with FT232H

## Pinout

Note that there are two versions of this board in the wild. It was updated on Feb. 12, 2020 to have a USB C connector, additional pinouts, and other features ([see product page for more info](https://www.adafruit.com/product/2264)).

Pinouts for both the **new version** (USB C) and the **original version** are below.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/862/medium800/sensors_ft232h_usbc_pintouts.jpg?1583268189)

![](https://cdn-learn.adafruit.com/assets/assets/000/081/360/medium800/sensors_ft232h_pinouts.png?1569352726)

Info: 

## Power Pins

- **5V** - this is the 5V power from the USB input.
- **GND** - this is the common ground for all power and logic.
- **3V power output** - The **new version** has a 3.3V power output pin for up to 500mA

## GPIO Pins

- **D4** to **D7** - can be used as either digital inputs or outputs.
- **C0** to **C7** - can be used as either digital inputs or outputs.  

## I2C Pins

- **SCL** - the I2C clock signal is on **D0**.
- **SDA** - the I2C data is on **D1+D2.** 
- **I2C switch** - The **new version** has a switch that connects D1 and D2 for easy I2C interfacing. **Move the switch to ON to use I2C** and/or the STEMMA QT connector. You can then use either D1 or D2 for SDA.

**On the original version only: Note that there are two pins (D1 and D2) which must be tied together and treated as one to use I2C.**

## SPI Pins

- **SCLK** - the SPI clock signal is on **D0**.
- **MOSI** - Microcontroller Out, Serial In is on **D1**.
- **MISO** - Microcontroller In, Serial Out is on **D2**.
- **CS0** - Chip Select is on **D3**. **This is not used by Blinka, instead use one of the GPIO pins from above (see example section).**

## STEMMA QT

- **STEMMA QT connector** - The **new version** has a [Stemma QT connector](https://www.adafruit.com/stemma) that lets you plug & play any [Stemma QT](https://www.adafruit.com/stemma) or Qwiic devices, sensors and displays. To use: make sure the I2C switch is set to ON to use the STEMMA QT connector.

# CircuitPython Libraries on any Computer with FT232H

## Examples

All right, now that all that annoying install stuff is done, let's have some fun.

The following sections will provide some basic examples for the main use cases - GPIO, I2C, and SPI.

Danger: 

## Installing Libraries for Breakouts

The general process for installing the CircuitPython library you are interested in will be the same as shown in the Python section of the Learn guide for your sensor. Just use pip3.

# CircuitPython Libraries on any Computer with FT232H

## GPIO

## Digital Output

Let's blink a LED!

Here's the bread board layout. The resistor can be something around 1kOhm. We don't need to make the LED super bright.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/392/medium800/sensors_gpio_led.png?1569372183)

First, let's do things interactively so you can see how it all works one line at a time. Start by launching Python:

```auto
python3
```

Then, at the Python **\>\>\>** prompt, enter the following to import the needed modules:

```auto
import board
import digitalio
```

Next we'll create our LED digital pin and set the mode to output:

```auto
led = digitalio.DigitalInOut(board.C0)
led.direction = digitalio.Direction.OUTPUT
```

And that should be it. You should be able to turn ON the LED with:

```auto
led.value = True
```

And turn it OFF with:

```auto
led.value = False
```

And here's a complete blink program you can run to make the LED blink forever.

```auto
import time
import board
import digitalio

led = digitalio.DigitalInOut(board.C0)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)

```

Save it as something like **blink.py** and then you can run it with:

```auto
python3 blink.py
```

![](https://cdn-learn.adafruit.com/assets/assets/000/081/391/medium800thumb/sensors_20190924_173716.jpg?1569372093)

## Digital Input

Let's read a button!

Here's the bread board layout. Use something like a 10kOhm resistor.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/395/medium800/sensors_gpio_button.png?1569373193)

We'll do this interactively also. So launch python:

```auto
python3
```

Then, at the Python **\>\>\>** prompt, enter the following to import the needed modules:

```auto
import board
import digitalio
```

And now we create our button digital pin and set it to input.

```auto
button = digitalio.DigitalInOut(board.C0)
button.direction = digitalio.Direction.INPUT
```

And that's it. To read the current state of the button use:

```auto
button.value
```

This will return **False** when the button is not pressed and **True** when it is pressed.

## Digtal Input and Output

Ok, let's put those two together and make the button turn on the LED. So we'll use two digital pins - one will be an input (button) and one will be an output (LED).

Here's the bread board layout.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/397/medium800/sensors_gpio_button_led.png?1569374373)

And here's the code.

```auto
import board
import digitalio

led = digitalio.DigitalInOut(board.C0)
led.direction = digitalio.Direction.OUTPUT

button = digitalio.DigitalInOut(board.C1)
button.direction = digitalio.Direction.INPUT

while True:
    led.value = button.value

```

Save that to a file with a name like **button\_and\_led.py** and then you can run it with:

```auto
python3 button_and_led.py
```

and the button should turn on the LED when pressed.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/396/medium800thumb/sensors_20190924_181431.jpg?1569374273)

# CircuitPython Libraries on any Computer with FT232H

## I2C

Let's talk to an I2C sensor.

We'll use the [BME280 sensor](https://www.adafruit.com/product/2652) which can read temperature, humidity, and pressure. Here's the wiring diagram:

![](https://cdn-learn.adafruit.com/assets/assets/000/088/881/medium800/sensors_i2c_bme280_usbc.png?1583278705)

For the older version of the board, you'll need to jumper D1 and D2 together:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/404/medium800/sensors_i2c_bme280.png?1569425882)

Info: 

Info: 

## Install BME280 Library

To install the BME280 library, run the following:

```auto
sudo pip3 install adafruit-circuitpython-bme280
```

Note that this step is the same as shown in the [main BME280 guide](https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout/python-circuitpython-test#python-installation-of-bme280-library-5-10). You would do the same thing for any other sensor.

## Run Example

Now we can run the simple test example from the library. Here's the code:

https://github.com/adafruit/Adafruit_CircuitPython_BME280/blob/main/examples/bme280_simpletest.py

Copy and save the above code and then run it with:

```auto
python3 bme280_simpletest.py
```

and you should see it print out sensor readings over and over:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/403/medium800/sensors_Screenshot_from_2019-09-25_08-36-13.png?1569425785)

## Using STEMMA QT

The new version of the FT232H features a [STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt) connector. This makes connecting to newer breakouts that also have a STEMMA QT connector super easy. Just use a STEMMA QT cable:

Featured
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long](https://www.adafruit.com/product/4401)
This 4-wire cable is a little over 200mm / 7.8" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4401)
[Related Guides to the Product](https://learn.adafruit.com/products/4401/guides)
![Angled shot of JST SH 4-Pin Cable - 200mm Long.](https://cdn-shop.adafruit.com/640x480/4401-04.jpg)

Featured
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

Featured
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
![Angled of of JST SH 4-Pin Cable.](https://cdn-shop.adafruit.com/640x480/4399-00.jpg)

And then you can just wire the FT232H and the STEMMA QT breakout directly together. You don't even need a breadboard or soldering.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/874/medium800/sensors_i2c_stemma_dps310_usbc.png?1583277578)

For breakout boards without a STEMMA QT connector, you can either use the header pins on both boards, that is, don't even use the STEMMA QT connector:

![](https://cdn-learn.adafruit.com/assets/assets/000/088/879/medium800/sensors_i2c_bme280_usbc.png?1583278380)

Or use the STEMMA QT connector on the FT232H breakout along with a STEMMA QT cable with one end of the cable cut off. You can then terminate the cut off end to the breakout in whatever way works best for your application.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/878/medium800/sensors_i2c_stemma_bme280_usbc.png?1583278303)

There are also some STEMMA QT cables with header connectors which might be useful:

Featured
### STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets

[STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets](https://www.adafruit.com/product/4397)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium female headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and...

In Stock
[Buy Now](https://www.adafruit.com/product/4397)
[Related Guides to the Product](https://learn.adafruit.com/products/4397/guides)
![Angled shot of JST SH 4-pin Cable with Premium Female Sockets.](https://cdn-shop.adafruit.com/640x480/4397-02.jpg)

Featured
### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

In Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)
![Angled Shot of the STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable.](https://cdn-shop.adafruit.com/640x480/4209-05.jpg)

# CircuitPython Libraries on any Computer with FT232H

## SPI

Info: The FT232H only supports SPI mode 0 and mode 2. (ref. FTDI AN 114)

Let's talk to a SPI sensor.

We can use the BME280 again, since it supports both I2C and SPI. Here's the SPI wiring:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/405/medium800/sensors_spi_bme280.png?1569427160)

Info: 

## Install BME280 Library

To install the BME280 library, run the following:

```auto
sudo pip3 install adafruit-circuitpython-bme280
```

Note that this step is the same as shown in the [main BME280 guide](https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout/python-circuitpython-test#python-installation-of-bme280-library-5-10). You would do the same thing for any other sensor.

## Run Example

We can run the [simple test example](https://github.com/adafruit/Adafruit_CircuitPython_BME280/blob/master/examples/bme280_simpletest.py) from the library. It is set up to use I2C by default, so we need to comment out the I2C stuff and uncomment the SPI stuff.

We also add an import for **digitalio** (since it wasn't in there) and change the CS pin to the one we are using with the FT232H - **C0**.

Here's the complete code:

```auto
import time

import board
import busio
import digitalio
import adafruit_bme280

# Create library object using our Bus I2C port
#i2c = busio.I2C(board.SCL, board.SDA)
#bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)

# OR create library object using our Bus SPI port
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
bme_cs = digitalio.DigitalInOut(board.C0)
bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, bme_cs)

# change this to match the location's pressure (hPa) at sea level
bme280.sea_level_pressure = 1013.25

while True:
    print("\nTemperature: %0.1f C" % bme280.temperature)
    print("Humidity: %0.1f %%" % bme280.humidity)
    print("Pressure: %0.1f hPa" % bme280.pressure)
    print("Altitude = %0.2f meters" % bme280.altitude)
    time.sleep(2)
```

Copy and save that code and then run it with:

```auto
python3 bme280_simpletest.py
```

and you should see it print out sensor readings over and over:

![](https://cdn-learn.adafruit.com/assets/assets/000/081/406/medium800/sensors_Screenshot_from_2019-09-25_08-36-13.png?1569427515)

# CircuitPython Libraries on any Computer with FT232H

## NeoPixels

# CircuitPython Libraries on any Computer with FT232H

## TFT Display

Let's draw to a display!

Here we'll use SPI to talk to a TFT display. And since we are on a powerful desktop PC, we can even use [Pillow](https://python-pillow.org/) (PIL) to do the graphical heavy lifting.

## Connect the Display

Here is the wiring diagram for connecting a [2.4" TFT LCD display](https://www.adafruit.com/product/2478) via SPI. We aren't using touch, so don't need to worry about those pins.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/484/medium800/sensors_tft_spi.png?1569528744)

## Install Pillow/PIL

We'll just point you to the official Pillow/PIL page so you can follow the install instruction there.

[Pillow Homepage](https://python-pillow.org/)
You should be able to just [use pip](https://pillow.readthedocs.io/en/stable/installation.html#basic-installation) though.

## Install CircuitPython RGB Display Library

This [library](https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display) provides support for the TFT display. To install, run:

```auto
sudo pip3 install adafruit-circuitpython-rgb-display
```

## Example Image

In this example, we'll load and display an image. Download the image below and save it to the same directory where the Python code will be stored. Make sure it is named **blinka.bmp**.

[blinka.bmp](https://cdn-learn.adafruit.com/assets/assets/000/081/486/original/blinka.bmp?1569529384)
## The Code

And here is the complete code listing to load and display the BMP file.

```auto
import board
import digitalio
import adafruit_rgb_display.ili9341 as ili9341
from PIL import Image

# Setup display
cs_pin = digitalio.DigitalInOut(board.C0)
dc_pin = digitalio.DigitalInOut(board.C1)
disp = ili9341.ILI9341(board.SPI(), cs=cs_pin, dc=dc_pin, baudrate=64000000)

# Load image and convert to RGB
image = Image.open('blinka.bmp').convert('RGB')

# Display it (rotated by 90 deg)
disp.image(image, 90)

```

Save the above with a filename like **tft\_image.py** and then run it with:

```auto
python3 tft_image.py
```

and boom! you should get a happy little Blinka showing up on your display.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/487/medium800/sensors_tft_demo.jpg?1569530221)

## Fancier Demo for Linux

There's a lot of power in Pillow/PIL. It can do more than just load and display images. Here's another example that creates a Draw object, uses a TTF font, and then grabs some stats from the PC and displays them.

https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/main/examples/rgb_display_pillow_stats.py

The example has import and code initialization for multiple displays. Uncomment the one for the display you are using, and comment out all others. If you are using the same 2.4" TFT (ILI9341) from above, then you don't need to change anything. The example uses that as default.

You will need to change the pins being used to match those on the FT232H. Find these lines of code and make things changes:

```python
# Configuration for CS and DC pins (these are PiTFT defaults):
cs_pin = digitalio.DigitalInOut(board.C0)
dc_pin = digitalio.DigitalInOut(board.C1)
reset_pin = None
```

With those changes in place, you should be able to run it and get some system stats showing up.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/491/medium800/sensors_tft_stats.jpg?1569536224)

And it will update in near real-time.

# CircuitPython Libraries on any Computer with FT232H

## FAQ & Troubleshooting

There's a few oddities when running Blinka/CircuitPython on Linux. Here's a list of stuff to watch for that we know of!

This FAQ covers all the various platforms and hardware setups you can run Blinka on. Therefore, some of the information may not apply to your specific setup.

## Update Blinka/Platform Libraries

**Most issues can be solved by forcing Python to upgrade to the latest `blinka` / `platform-detect` libraries**. Try running

`sudo python3 -m pip install --upgrade --force-reinstall adafruit-blinka Adafruit-PlatformDetect`

### Getting an error message about 'board' not found or 'board' has no attribute

Somehow you have ended up with either the wrong&nbsp; **board** &nbsp;module or no&nbsp; **board** &nbsp;module at all.

**DO NOT** &nbsp;try to fix this by manually installing a library named&nbsp;`board`. There is&nbsp;[one out there](https://pypi.org/project/board/)&nbsp;and it has nothing to do with Blinka. You will break things if you install that library!

The easiest way to recover is to simply force a reinstall of Blinka with:  
`python3 -m pip install --upgrade --force-reinstall adafruit-blinka`

Additionally, and especially if you are using a more recent version of Python, you may run into this error if you either do not have a Virtual Environment active or setup. See the [Python Virtual Environment Usage on Raspberry Pi](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi) guide for more information or check out the guide's Installation page.

### 
       
       
       
       
       
       
       
       
       
       Mixed SPI mode devices 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Due to the way we share an SPI peripheral, you cannot have two SPI devices with different 'mode/polarity' on the same SPI bus - you'll get weird data

95% of SPI devices are mode 0, check the driver to see mode or polarity settings. For example:

- [LSM9DS1 is mode 1](https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1/blob/master/adafruit_lsm9ds1.py#L408), please use in I2C mode instead of SPI
- [MAX31865 is phase 1](https://github.com/adafruit/Adafruit_CircuitPython_MAX31865/blob/master/adafruit_max31865.py#L97), try using this on a separate SPI device, or read data twice.

### 
       
       
       
       
       
       
       
       
       
       Why am I getting AttributeError: 'SpiDev' object has no attribute 'writebytes2'? 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

This is due to having an older version of [spidev](https://pypi.org/project/spidev/). You need at least version 3.4. This should have been [taken care of](https://github.com/adafruit/Adafruit_Blinka/blob/8a4686cbc7ebd7f338f64517fa42db4dc5b5c78c/requirements.txt#L6) when you installed Blinka, but in some cases it does not seem to happen.

To check what version of spidev Python is using:

> `$ python3`  
> `Python 3.6.8 (default, Oct 7 2019, 12:59:55) `  
> `[GCC 8.3.0] on linux`  
> `Type "help", "copyright", "credits" or "license" for more information.`  
> `>>> import spidev`  
> `>>> spidev. __version__ `  
> `'3.4'`  
> `>>>`

If you see a version lower then 3.4 reported, then try a force upgrade of spidev with (back at command line):

`sudo python3 -m pip install --upgrade --force-reinstall spidev`

### No Pullup/Pulldown support on some Linux boards or MCP2221

Some Linux boards, for example, AllWinner-based, do not have support to set pull up or pull down on their GPIO. Use an external resistor instead!

### Getting OSError: read error with MCP2221

If you are getting a stack trace that ends with something like:

> `return self._hid.read(64)`  
> `File "hid.pyx", line 122, in hid.device.read`  
> `OSError: read error`

Try setting an environment variable named **BLINKA\_MCP2221\_RESET\_DELAY** to a value of **0.5 or higher**.

Windows:

`set BLINKA_MCP2221_RESET_DELAY=0.5`

Linux:

`export BLINKA_MCP2221_RESET_DELAY=0.5`

This is a value in seconds to wait between resetting the MCP2221 and the attempt to reopen it. The reset is seen by the operating system as a hardware disconnect/reconnect. Different operating systems can need different amounts of time to wait after the reconnect before the attempt to reopen. Setting the above environment variable will override the default reset delay time, allowing it to be increased as needed for different setups.

### 
       
       
       
       
       
       
       
       
       
       Using FT232H with other FTDI devices. 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Blinka uses the libusbk driver to talk to the FT232H directly. If you have other FTDI devices installed that are using the FTDI VCP drivers, you may run into issues. See here for a possible workaround:

[https://forums.adafruit.com/viewtopic.php?f=19&t=166999](https://forums.adafruit.com/viewtopic.php?f=19&t=166999)

### 
       
       
       
       
       
       
       
       
       
       Getting 

This is probably only an issue for older versions of Windows. If you run into something like this, see this issue thread:

[https://github.com/pyusb/pyusb/issues/120](https://github.com/pyusb/pyusb/issues/120)

which describes copying the 32bit and 64bit DLLs into specific folders. ([example for Win7](https://github.com/pyusb/pyusb/issues/120#issuecomment-322058585))

### 
       
       
       
       
       
       
       
       
       
        Getting 

Check out this issue thread:

[https://github.com/pyusb/pyusb/issues/355](https://github.com/pyusb/pyusb/issues/355 "https://github.com/pyusb/pyusb/issues/355")

which has **lots** of discussion. It is probably worth reading through it all to determine what applies for your setup.&nbsp; Most solutions seem to rely on setting the **DYLD\_LIBRARY\_PATH** environment variable.

This issue thread has further information:

[https://github.com/orgs/Homebrew/discussions/3424](https://github.com/orgs/Homebrew/discussions/3424)

### 
       
       
       
       
       
       
       
       
       
       I can't get neopixel, analogio, audioio, rotaryio, displayio or pulseio to work! 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Some CircuitPython modules like may not be supported.

- Most SBCs do not have analog inputs so there is no `analogio`
- Few SBCs have `neopixel` support so that is only available on Raspberry Pi (and any others that have low level neopixel protocol writing
- Rotary encoders (`rotaryio`) is handled by interrupts on microcontrollers, and is not supported on SBCs at this time
- Likewise `pulseio` PWM support is not supported on many SBCs, and if it is, it will not support a carrier wave (Infrared transmission)
- For display usage, we suggest using python `Pillow` library or `Pygame`, we do not have `displayio` support

We aim to have, at a minimum, `digitalio` and `busio` (I2C/SPI). This lets you use the vast number of driver libraries

For analog inputs,[the MCP3xxx library](https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx) will give you `AnalogIn` objects. For PWM outputs, [try the PCA9685](https://github.com/adafruit/Adafruit_CircuitPython_PCA9685). For audio, use pygame or other Python3 libraries to play audio.

Some libraries, like [Adafruit\_CircuitPython\_DHT](https://github.com/adafruit/Adafruit_CircuitPython_DHT) will try to bit-bang if pulsein isn't available. Slow linux boards (\<700MHz) may not be able to read the pins fast enough), you'll just have to try!

### 
       
       
       
       
       
       
       
       
       
       Help, I'm getting the message 

It looks like **libgpiod** may not be installed on your board.

Try running the command: `sudo apt-get install libgpiod2`

### 
       
       
       
       
       
       
       
       
       
       = v5.5.0

Be sure you have the latest libgpiod.py script and run it with the `-l` or `--legacy` flag:

`sudo python3 libgpiod.py --legacy`

All Raspberry Pi Computers Have:

- 1 x I2C port with **busio** (but clock stretching is not supported in hardware, so you must set the I2C bus speed to 10KHz to 'fix it')
- 2 x SPI ports with **busio** 
- 1 x UART port with **serial** - note this is shared with the hardware console
- **pulseio.pulseIn** using gpiod
- **neopixel** support on a few pins
- No AnalogIn support (Use an MCP3008 or similar to add ADC)
- No PWM support (Use a PCA9685 or similar to add PWM)

![sensors_raspberry_pi.jpg](https://cdn-learn.adafruit.com/assets/assets/000/077/099/medium640/sensors_raspberry_pi.jpg?1560709288)

Google Coral TPU Dev Boards Have:

- 1 x I2C port with **busio**
- 1 x SPI ports with **busio** 
- 1 x UART port with **serial** - note this is shared with the hardware console
- 3 x PWMOut support
- No NeoPixel support
- No AnalogIn support (Use an MCP3008 or similar to add ADC)

![sensors_google_coral.jpg](https://cdn-learn.adafruit.com/assets/assets/000/077/100/medium640/sensors_google_coral.jpg?1560709528)

Orange Pi PC Plus Boards Have:

- 1 x I2C port with **busio**
- 1 x SPI ports with **busio** 
- 1 x UART port with **serial**
- No NeoPixel support
- No AnalogIn support (Use an MCP3008 or similar to add ADC)
- No PWM support (Use a PCA9685 or similar to add PWM)

![sensors_47688275371_ab6f25d2f2_k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/077/102/medium640/sensors_47688275371_ab6f25d2f2_k.jpg?1560709858)

Orange Pi R1 Boards Have:

- 1 x I2C port with **busio**
- 1 x SPI port with **busio** 
- 1 x UART port with **serial**
- No NeoPixel support
- No AnalogIn support (Use an MCP3008 or similar to add ADC)
- No PWM support (Use a PCA9685 or similar to add PWM)

![sensors_orange_pi_r1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/077/105/medium640/sensors_orange_pi_r1.jpg?1560710441)

ODROID C2 Boards Have:

- 1 x I2C port with&nbsp; **busio**
- No SPI support
- 1 x UART port with **serial** - note this is shared with the hardware console
- No NeoPixel support
- No AnalogIn support (Use an MCP3008 or similar to add ADC)
- No PWM support (Use a PCA9685 or similar to add PWM)

![sensors_product.jpg](https://cdn-learn.adafruit.com/assets/assets/000/077/107/medium640/sensors_product.jpg?1560710758)

DragonBoard 410c Boards Have:

- 2 x I2C port with&nbsp; **busio**
- 1 x SPI port with&nbsp; **busio**
- 1 x UART port with&nbsp; **serial**
- No NeoPixel support
- No AnalogIn support (Use an MCP3008 or similar to add ADC)
- No PWM support (Use a PCA9685 or similar to add PWM)

![sensors_dragonboard410c.jpg](https://cdn-learn.adafruit.com/assets/assets/000/077/714/medium640/sensors_dragonboard410c.jpg?1562085887)

NVIDIA Jetson Nano Boards Have:

- 2 x I2C port with&nbsp; **busio**
- 2 x SPI ports with **busio**
- 2 x UART port with&nbsp; **serial** &nbsp;- note one of these is shared with the hardware console
- No NeoPixel support
- No AnalogIn support (Use an MCP3008 or similar to add ADC)
- No PWM support (Use a PCA9685 or similar to add PWM)

![sensors_faq_troubleshooting.jpg](https://cdn-learn.adafruit.com/assets/assets/000/080/798/medium640/sensors_faq_troubleshooting.jpg?1568157791)

FT232H Breakouts Have:

- 1x I2C port **OR** SPI port with **busio**
- 12x GPIO pins with **digitalio**
- No UART
- No AnalogIn support
- No AnalogOut support
- No PWM support

If you are using [Blinka in FT232H mode](https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h), then keep in mind these basic limitations.

- SPI and I2C can not be used at the same time since they share the same pins.
- GPIO speed is not super fast, so trying to do arbitrary bit bang like things may run into speed issues.
- There are no ADCs.
- There are no DACs.
- UART is not available (its a different FTDI mode)

![sensors_2264-04.jpg](https://cdn-learn.adafruit.com/assets/assets/000/081/745/medium640/sensors_2264-04.jpg?1569886041)

MCP2221 Breakouts Have:

- 1x I2C port with **busio**
- 4x GPIO pins with **digitalio**
- 3x AnalogIn with **analogio**
- 1x AnalogOut with **analogio**
- 1x UART with **pyserial**
- No PWM support
- No hardware SPI support

If you are using Blinka in MCP2221 mode, then keep in mind these basic limitations.

- GPIO speed is not super fast, so trying to do arbitrary bit bang like things may run into speed issues.
- UART is available via `pyserial`, the serial COM port shows up as a second USB device during enumeration

![sensors_mcp2221_small_iso.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/115/medium640/sensors_mcp2221_small_iso.jpg?1576799406)


## Guide Products

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long](https://www.adafruit.com/product/4401)
This 4-wire cable is a little over 200mm / 7.8" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4401)
[Related Guides to the Product](https://learn.adafruit.com/products/4401/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets

[STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets](https://www.adafruit.com/product/4397)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium female headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and...

In Stock
[Buy Now](https://www.adafruit.com/product/4397)
[Related Guides to the Product](https://learn.adafruit.com/products/4397/guides)
### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

In Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)

## Related Guides

- [Introducing Adafruit Feather RP2040](https://learn.adafruit.com/adafruit-feather-rp2040-pico.md)
- [No-Code, No-Solder Monitoring For Perfect Bread](https://learn.adafruit.com/no-code-no-solder-temperature-monitoring-with-wippersnapper-offline.md)
- [Adafruit TRRS Trinkey](https://learn.adafruit.com/adafruit-trrs-trinkey.md)
- [Sound Reactive LED Top Hat](https://learn.adafruit.com/sound-reactive-led-top-hat.md)
- [USB C Power Delivery Monitor](https://learn.adafruit.com/usb-c-benchtop-power-supply.md)
- [Adafruit CircuitPython Wii Classic Controller Library](https://learn.adafruit.com/adafruit-circuitpython-wii-classic-controller-library.md)
- [No-Code Indoor Air Quality Monitor with Separate Display](https://learn.adafruit.com/no-code-indoor-air-quality-monitor-with-separate-display.md)
- [Mini LED Matrix Audio Visualizer](https://learn.adafruit.com/mini-led-matrix-audio-visualizer.md)
- [LED Matrix Alarm Clock](https://learn.adafruit.com/led-matrix-alarm-clock.md)
- [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040.md)
- [Wireless LED Juggling Balls with ESP-NOW](https://learn.adafruit.com/wireless-juggling-balls-esp-now.md)
- [Icicle Crown with Pebble Pixels & WLED](https://learn.adafruit.com/icicle-crown-with-pebble-pixels-wled.md)
- [Feather TFT STEMMA Case](https://learn.adafruit.com/feather-tft-stemma-case.md)
- [MacroPad 2FA TOTP Authentication Friend](https://learn.adafruit.com/macropad-2fa-totp-authentication-friend.md)
- [Clue Coffee Scale](https://learn.adafruit.com/clue-coffee-scale.md)
