Binho + CircuitPython
The Binho Nova host adapter works seamlessly with CircuitPython. You can leverage all of the open-source device drivers and example code right from your PC. In the video below, Shannon Morse walks through the process of setting this up from scratch, starting with Python installation, and shows how simple it is to use with Nova.
The same instructions presented in the video can be found below for easy reference, along with some additional examples.
Setup
Prerequisites
This guide presumes that you already have Python 3.x and pip installed on your computer.
You can verify these requirements by entering the following command:
Step 1: Setup Binho Nova Host Adapter Hardware
The Binho Nova Multi-Protocol USB Host Adapter utilizes the standardized USB Communications Device Class driver in order to achieve maximum compatibility with as many systems as possible. As such, there's no driver to download and install for most operating systems.
Certain operating systems like Mac and Ubuntu may require additional permissions to start using Binho Nova. In addition, Windows 7 does not have the standard USB CDC driver included as default.
Please check the following guide to setup permissions on Mac/Ubuntu and Windows 7 driver setup:
Software InstallationStep 2: Install the Binho Host Adapter Libraries
Verify Nova can communicate with binhoHostAdapter python library:
Step 3: Install Adafruit Blinka
Step 4: Set BLINKA_NOVA environment variable
In order for Adafruit Blinka libraries to use Binho Nova, set the BLINKA_NOVA environment variable with the following command:
Windows Command line:
Windows Powershell:
Mac/Ubuntu:
Verify Binho Nova’s environment variable is set and Adafruit Blinka libraries can recognize and communicate with the adapter:
Examples
For the examples shown below, it may make sense to review the Connecting the Hardware guide which includes the pinout of the Binho Nova connector for easy reference.
Connecting the HardwareBosch BME280 Temperature, Barometic Pressure, and Humidity Sensor
Install circuitpython bme280 python library:
SPI Bus Example:
This example uses Adafruit’s digitalio package to create a DigitalInOut object for Chip Select Pin and busio package to create a SPI object.
I2C Bus Example:
This example uses Adafruit’s busio package to create an I2C object.
Running the example code:
Blinking and Pulsing LED
GPIO Example:
This example uses Adafruit’s digitalio package to create a DigitalInOut object.
PWM Example:
This example uses Adafruit’s pulseio package to create a PWMOut object.
Running the example code:
UART Bridge
The following UART example uses an FTDI USB Cable.
This example uses Adafruit’s busio package to create a UART object. It will read 3 characters from the FTDI cable which CoolTerm is connected to. The script then sends ‘hello world’ to the FTDI cable which will display in CoolTerm.
Running the example code:
Last updated