【发布时间】:2019-01-05 01:57:26
【问题描述】:
我已经搞砸了我的大脑和网络尝试在 BBB 上自学 PWM。我是 Python 和小猎犬骨黑的新手。我想做的就是用我的电压表检查 PWM,看看它正在改变,但代码不断崩溃:
beaglebone black (Rev. C) 预装了 Debian GNU/Linux 8.4 Jessie。我最近才买的。
Debian 是一个 Linux 操作系统,它也安装了 Python 2.7.9,因此它可以从 shell 运行。我正在尝试跟随 TopTechBoy 在 Youtube (https://www.youtube.com/watch?v=vAR8v96J3FQ) 上的这个非常好的在线教程。这个视频是在 2015 年完成的,所以我认为 python 和 beaglebones 的世界可能已经发生了很多变化,以至于如果你在当前的板上运行代码,它就行不通了。现在所有的课程也都奏效了。这是我试图运行的代码:
import Adafruit_BBIO.PWM as PWM
for i in range(0,5):
DC = int(raw_input("What Duty Cycle Would You Like? "))
PWM.start("P8_13", 0)
PWM.set_duty_cycle("P8_13", DC)
PWM.stop("P8_13")
PWM.cleanup()
这会导致错误:
Traceback (most recent call last):
File "PWM1.py", line 6, in <module>
PWM.set_duty_cyle("P8_13", DC)
IOError: [Errno 2] No such file or directory: '/slots'
谁能帮我解决这个问题?
【问题讨论】: