我无法将端口JAVA串行到Arduino .. 我收到此错误
加载RxTx Windows 10
java.lang.UnsatisfiedLinkError:在抛出java.library.path时没有rxtxSerial
加载gnu.io.RXTXCommDriver
线程“main”java.lang.UnsatisfiedLinkError中的异常:
中没有rxtxSerial的java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier。(CommPortIdentifier.java:123)
at org.sintef.jarduino.comm.Serial4JArduino.connect(Serial4JArduino.java:88)
at org.sintef.jarduino.comm.Serial4JArduino。(Serial4JArduino.java:82)
at org.sintef.jarduino.AbstractJArduino。(AbstractJArduino.java:30)
at org.sintef.jarduino.JArduino。(JArduino.java:45)
在Arduino.ArduinoServer。(ArduinoServer.java:25)
在Arduino.ArduinoServer.main(ArduinoServer.java:37)
JAVA CODE
package Arduino;
import java.net.URISyntaxException;
import java.util.Scanner;
import org.sintef.jarduino.DigitalPin;
import org.sintef.jarduino.DigitalState;
import org.sintef.jarduino.JArduino;
import org.sintef.jarduino.PinMode;
public class ArduinoServer extends JArduino{
public ArduinoServer(String port) {
super(port);
// TODO Auto-generated constructor stub
}
static int LedParlakligi=0;
public static void main(String[] Args)
{
String serialPort;
serialPort = "1";
JArduino arduino = new ArduinoServer(serialPort);
arduino.runArduinoProcess();
}
@Override
protected void loop() {
digitalWrite(DigitalPin.PIN_9, DigitalState.fromValue((byte)10));
delay(50); // wait for a second
}
@Override
protected void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(DigitalPin.PIN_9, PinMode.OUTPUT);
}
}
我的图书馆全部 Libraires
答案 0 :(得分:0)
您需要在计算机上安装本机库:http://rxtx.qbang.org/wiki/index.php/Download
在Eclipse中链接到它: 项目 - >属性 - > Java构建路径 - >图书馆 - > RXTXcomm - >本地库位置