Com port don't work in java
- by ?????? ?????
Does't work with java... don't sent message to my microchip. please help
public static void main(String[] args) {
SerialPort serialPort = new SerialPort("COM1");
try {
serialPort.openPort();
serialPort.setParams(9600, 8, 1, 0);
serialPort.setParams(SerialPort.BAUDRATE_9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
serialPort.writeBytes("Test");
readBytes(), ???? ?? ??????? ??????
byte[] buffer = serialPort.readBytes(10);
//????????? ????
serialPort.closePort();
}
catch (SerialPortException ex) {
System.out.println(ex);
}
}
}
byte[] Write "[@B********" Star is a random number.