【发布时间】:2012-09-11 19:13:48
【问题描述】:
我正在使用processing lib,我想用它创建一个虚拟串行端口,并且通过其他读取,有很多读取串行端口的示例,但我没有找到如何打开串行端口,我该如何做到这一点.
【问题讨论】:
标签: java linux serial-port virtual processing
我正在使用processing lib,我想用它创建一个虚拟串行端口,并且通过其他读取,有很多读取串行端口的示例,但我没有找到如何打开串行端口,我该如何做到这一点.
【问题讨论】:
标签: java linux serial-port virtual processing
来自您引用的链接,http://www.processing.org/reference/libraries/serial/Serial.html:
// Example by Tom Igoe
import processing.serial.*;
// The serial port:
Serial myPort;
// List all the available serial ports:
println(Serial.list());
// Open the port you are using at the rate you want:
myPort = new Serial(this, Serial.list()[0], 9600);
// Send a capital A out the serial port:
myPort.write(65);
【讨论】: