我正在使用“处理”,并且在java模式下,我可以通过以下方式写入串行端口:
import processing.serial.*;
port = new Serial(this,Serial.list()[0] , 9600);
port.write('3')
以及在python处理中:
add_library('serial')
port = Serial(this,Serial.list()[0] , 9600)
port.write('3')
在Java中,一切正常,但在python中,语句出现错误
'port.write('3'):
"processing.app.SketchException: TypeError: write(): expected 2 args; got 1"