新版树莓派3的系统可能不再兼容wiringpi-python,运行会提示:
Unable to determine hardware version. I see: Hardware : BCM2835
- expecting BCM2708 or BCM2709.
If this is a genuine Raspberry Pi then please report this
to projects@drogon.net. If this is not a Raspberry Pi then you
are on your own as wiringPi is designed to support the
Raspberry Pi ONLY.
这是因为wiringpi-python库还没更新导致的,因此需要手动安装wiringpi-python,感谢neuralpi为我们提供修改版的wiringpi-python
安装之前,需要先安装swig2.0和python-dev
sudo apt-get install swig2.0 python-dev
接下来安装wiringpi-python:
git clone --recursive https://github.com/neuralpi/WiringPi-Python.git
cd WiringPi-Python/WiringPi
sudo ./build
cd ..
swig2.0 -python wiringpi.i
sudo python setup.py install
sudo python3 setup.py install