我在这里尝试这个教程: http://www.instructables.com/id/Orange-Pi-One-Python-GPIO-basic/?ALLSTEPS
每当我执行.py文件时,都会出现错误“cannot import name'gpio'”
以下是我在安装完其他所有东西后使用的代码,在tut中声明:
#import the library
from pyA20.gpio import gpio
from pyA20.gpio import port
from time import sleep
#initialize the gpio module
gpio.init()
#setup the port (same as raspberry pi's gpio.setup() function)
gpio.setcfg(port.PA7, gpio.OUTPUT)
#now we do something (light up the LED)
gpio.output(port.PA7, gpio.HIGH)
#turn off the LED after 2 seconds
sleep(2)
gpio.output(port.PA7, gpio.LOW)
我对这一切都很陌生,所以请容忍我。 非常感谢你。在
橙色圆周率也有同样的问题。。。我从https://pypi.python.org/pypi/pyA10Lime获得了python库,然后它就工作了:
可用链接https://forum.armbian.com/index.php?/topic/3655-guide-orange-pi-zero-gpios/
相关问题 更多 >
编程相关推荐