pygame 1.9.4.post1 Hello from the pygame community. https://www.pygame.org/contribute.html /home/pi/CLBDEMO/0602.py:9: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(12, GPIO.OUT) /home/pi/CLBDEMO/0602.py:10: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(13, GPIO.OUT) /home/pi/CLBDEMO/0602.py:11: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(16, GPIO.OUT) /home/pi/CLBDEMO/0602.py:13: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(18, GPIO.OUT) /home/pi/CLBDEMO/0602.py:14: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(27, GPIO.OUT) /home/pi/CLBDEMO/0602.py:16: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(22, GPIO.OUT) Traceback (most recent call last): File "/home/pi/CLBDEMO/0602.py", line 42, in <module> GPIO.add_event_detect(23, GPIO.RISING, callback=detect_obstacle, bouncetime=200) RuntimeError: Failed to add edge detection
时间: 2024-03-15 14:43:12 浏览: 361
pygame-1.9.4.dev0.tar.gz
这是Pygame的欢迎信息,不是错误提示。而后面的“RuntimeWarning”是由于GPIO库在设置GPIO管脚时,有部分管脚已经被占用了,但是程序还是继续执行了。如果你不想看到这个警告,可以使用`GPIO.setwarnings(False)`来禁用警告。
而最后的错误提示则是由于在运行脚本时,GPIO库无法正确添加边缘检测。可能的原因是你的GPIO库版本过低或者你的硬件连接有问题。你可以尝试更新GPIO库或者检查硬件连接是否正确。另外,你也可以尝试使用其他的GPIO库来解决这个问题。
阅读全文