环境:
树莓派3B;
python版本是2.7.9;
HC-SR04超声波测距模块Trig脚连接树莓派23(BCM);
Echo交连接树莓派24(BCM);
程序如下:
出现以下报错:
请大神帮帮看看什么情况,咋回事啊?
谢谢啦!!!
GPIO的库安装了没有啊。
Python2安装GPIO库需要输入命令: sudo apt-get install python-rpi.gpio Python3安装GPIO库需要输入命令: sudo apt-get install python3-rpi.gpio