【问题标题】:Processing open a virtual serial port处理打开一个虚拟串口
【发布时间】:2012-09-11 19:13:48
【问题描述】:

我正在使用processing lib,我想用它创建一个虚拟串行端口,并且通过其他读取,有很多读取串行端口的示例,但我没有找到如何打开串行端口,我该如何做到这一点.

【问题讨论】:

    标签: java linux serial-port virtual processing


    【解决方案1】:

    来自您引用的链接,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);
    

    【讨论】:

    • 我在 Serial.list() 中得到 0 个端口,如果我打印 Serial.list().length,则输出为 0
    • 听起来您的库在您的硬件上找不到任何串行端口 :) API 无法帮助您 - 这是操作系统/配置问题。
    • 谷歌搜索“linux 虚拟串口”,如果您还没有解决方案。例如:How to create a virtual serial/COM port,或Linux virtual Serial Port。我不确定您的具体环境或要求,但这应该可以帮助您入门。
    • 是的,我正在学习它。我今天搜索了很长时间,但谢谢大家:)。
    猜你喜欢
    • 2013-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-31
    • 1970-01-01
    • 2019-10-22
    • 1970-01-01
    • 2012-07-27
    相关资源
    最近更新 更多