我试图在PyCharm 2021.3.3上设置MicroPython,不幸的是我无法成功地将我的开发板连接到IDE。我正在尝试使用工具〉〉MicroPython〉〉MicroPython REPL:
Found the device, but could not connect via port 'COM4': could not open port 'COM4': PermissionError(13, 'Odmowa dostępu.', None, 5)
I'm not sure what to suggest. :-(
Press ENTER to continue
然后我试图刷新简单的程序来控制尽管以前的错误,它吐出:
Connecting to COM4
Traceback (most recent call last):
File "C:\Users\reczul\AppData\Roaming\JetBrains\PyCharm2021.3\plugins\intellij-micropython\scripts\microupload.py", line 139, in <module>
main(sys.argv[1:])
File "C:\Users\reczul\AppData\Roaming\JetBrains\PyCharm2021.3\plugins\intellij-micropython\scripts\microupload.py", line 56, in main
board = Pyboard(port)
File "C:\Users\reczul\PycharmProjects\pythonProject1\venv\lib\site-packages\ampy\pyboard.py", line 147, in __init__
raise PyboardError('failed to access ' + device)
ampy.pyboard.PyboardError: failed to access COM4
如何修复此错误?
我使用的示例代码:
from machine import Pin, Timer
led = Pin(25, Pin.OUT)
tim = Timer()
def tick(timer):
global led
led.toggle()
tim.init(freq=2.5, mode=Timer.PERIODIC, callback=tick)```
1条答案
按热度按时间u3r8eeie1#
假设您使用的是Pi皮科。
出现此错误的原因很可能是在插入设备时按下了“BOOTSEL”按钮。
将您的UF2文件拖到设备上,它应该会重新启动。不要拔下设备并按住“BOOTSEL”。
现在应该可以走了。