LoginSignup
2
5

More than 5 years have passed since last update.

NanoPiでwiringPi

Last updated at Posted at 2016-11-17

WiringOPを使ってNanoPiでwiringPiで遊ぶ。

予備知識

WiringOPはOrangePiのwiringPi。OrangePiのプロセッサは Allwiner H3。NanoPi-M1 や NanoPi-Neo は同じプロセッサを使っている。

GPIO番号はNanoPi-NeoはデフォルトでWiringPiになっていて使いやすい。

下準備

インストール、ログインなどは「Piで遊ぼう」を参照して済ましておいて下さい。
http://qiita.com/nanbuwks/items/11cba54cdc209db48f28

apt-get update
apt-get install git-core
apt-get install sudo

コマンドラインで使おう!

以下をすると、コマンドラインから gpio コマンドが使えるようになります。

git clone https://github.com/zhaolei/WiringOP.git -b h3
cd WiringOP
chmod 777 build
./build

pythonで使おう!

上のやりかたで、コマンドラインから使うWiringPiはインストールされるが、Pythonからは使えない。更に作業。

いろいろ入ってないので入れておく

apt-get install python swig python-dev python-setuptools
git clone --recursive https://github.com/lanefu/WiringPi-Python-OP
cd WiringPi-Python-OP/
swig2.0 -python wiringpi.i
python setup.py install

python3で使おう!

apt-get install swig python3-dev python3-setuptools
git clone --recursive https://github.com/lanefu/WiringPi-Python-OP
cd WiringPi-Python-OP/
swig2.0 -python wiringpi.i
python3 setup.py install
2
5
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
2
5