Adafruit Blinka provides CircuitPython APIs for non-CircuitPython versions of Python, primarily CPython on Linux. It allows users to run CircuitPython code on single-board computers like the Raspberry Pi, Jetson Nano, and others. The library is actively maintained with frequent releases (multiple per month) to add support for new boards, fix board-specific import paths, and address underlying system library interactions. The current version is 9.0.4.
pip install adafruit-blinkaVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to blink an LED using Blinka's CircuitPython-like API. It initializes a digital output pin and toggles its state. Users must ensure Blinka is properly set up for their specific single-board computer, including installing necessary system dependencies and configuring user permissions for GPIO access. The `LED_PIN` variable must be adjusted to a valid pin name for the target board.
Install required packages: `sudo apt-get update && sudo apt-get install -y python3-pip libgpiod-dev python3-libgpiod build-essential python3-dev` (for Debian/Ubuntu based systems).
Add your user to the `gpio` group: `sudo usermod -a -G gpio $(whoami)` then reboot your system (`sudo reboot`).
For general users, ensure you are on `9.0.2` or newer to resolve packaging issues. For custom board developers, consult the Blinka GitHub repository for updated guidelines on board definitions.
Consult your board's specific Blinka setup guide (e.g., on learn.adafruit.com). Ensure `export BLINKA_BOARD=<YourBoardName>` is set if required for your board (e.g., `BLINKA_BOARD=RASPBERRY_PI_ZERO`). Double-check the pinout for your hardware.
Install `libgpiod-dev` and `python3-libgpiod`: `sudo apt-get install -y libgpiod-dev python3-libgpiod`.
Ensure you are on `adafruit-blinka>=9.0.2`. If the issue persists, explicitly set the board with an environment variable (e.g., `export BLINKA_BOARD=RASPBERRY_PI_ZERO`) and check your board's specific Blinka setup guide.
Add your user to the `gpio` group: `sudo usermod -a -G gpio $(whoami)` and then reboot the system (`sudo reboot`).
Verify the pin name against your board's official pinout and Blinka's documentation for that board. Ensure your board is correctly identified (see `BLINKA_BOARD` environment variable in warnings). If using a custom board, check its JSON definition.