0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry Pi に CircuitPython をインストールする

Posted at

Raspberry Pi でセンサーなどを取り付けてなにかをするという場合、他社製のセンサーを使用していても、Adafruit のライブラリを使うと非常に簡単にできたりしますが、現時点では多くのライブラリで CircuitPython がインストールされていることが前提条件になっています。

Raspberry Pi OS に CircuitPython をインストールするには Adafruit の adafruit_blinka を使い簡単にインストールできますが本エントリでは その方法 の紹介します。因みに現時点 (2022/02/12) ではまだ 64-bit の Raspberry Pi OS はサポートされていません。

まず前準備として以下のコマンドを実行します。

$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install python3-pip -y
$ sudo pip3 install --upgrade setuptools

CircuitPython をインストールするには以下のコマンドを実行します。

$ cd ~
$ sudo pip3 install --upgrade adafruit-python-shell
$ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
$ sudo python3 raspi-blinka.py

raspi-blinka.py を実行すると以下のようなログがターミナルに出力され最後再起動をするか聞かれるので Y と押して Enter を押します。

This script configures your
Raspberry Pi and installs Blinka

RASPBERRY_PI_ZERO_W detected.

Updating System Packages
Blinka Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Blinka Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Blinka Reading package lists...
Upgrading packages...
Blinka Reading package lists...
<snip>
Blinka Successfully installed adafruit-blinka-6.20.1 pyftdi-0.53.3 pyusb-1.2.1 rpi-ws281x-4.3.1 sysv-ipc-1.1.0
DONE.

Settings take effect on next boot.

REBOOT NOW? [Y/n] Y

Raspberry Pi が再起動したら次の curl コマンドの行を実行してみてください。正常にインストールされている場合は以下のような出力となります。

$ curl -s https://learn.adafruit.com/pages/12762/elements/2993427/download | python3
Hello blinka!
Digital IO ok!
I2C ok!
SPI ok!
done!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?