pySerialライブラリを使用して、ArduinoからのPythonスクリプトログデータを取得しています。スクリプトが指定されたポートに接続できず、Eclipseが「未定義の変数:SerialException」と表示する場合に、SerialExceptionを処理しようとしています。インポートし忘れたものはありますか?
コード:
try:
ser = serial.Serial(port, 9600)
connected = 1
except SerialException:
print "No connection to the device could be established"