0
我有以下腳本:如何解決nxt.motor.BlockedException?
#!/usr/bin/env python
import nxt.locator
from nxt.motor import *
def spin_around(b):
m_left = Motor(b, PORT_B)
m_left.turn(100, 360)
m_right = Motor(b, PORT_C)
m_right.turn(-100, 360)
print("Script Starting")
b = nxt.locator.find_one_brick()
spin_around(b)
我已經安裝了pyUSB和libusb的。我運行python spin.py
但是劇本,當我運行該腳本,我得到以下異常:
Script Starting
Traceback (most recent call last):
File "spin.py", line 14, in <module>
spin_around(b)
File "spin.py", line 8, in spin_around
m_left.turn(100, 360)
File "/Library/Python/2.7/site-packages/nxt/motor.py", line 211, in turn
raise BlockedException("Blocked!")
nxt.motor.BlockedException: Blocked!
這是爲什麼呢例外發生?