Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
lastmait dijo:ok gracias me sale este error:
unable to access jarfile rs232
package ejem1serial;
import gnu.io.CommPort;
import gnu.io.CommPortIdentifier;
import gnu.io.PortInUseException;
import gnu.io.SerialPort;
import gnu.io.UnsupportedCommOperationException;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws PortInUseException, IOException, UnsupportedCommOperationException {
Enumeration comport= CommPortIdentifier.getPortIdentifiers();
CommPortIdentifier myCPI = null;
Scanner mySC;
PrintStream myPS;
while(comport.hasMoreElements())
{
myCPI = (CommPortIdentifier) comport.nextElement();
if(myCPI.getName().equals("COM3"))
break;
}
CommPort puerto= myCPI.open("puerto serial", 2000);
SerialPort mySP= (SerialPort)puerto;
mySP.setSerialPortParams(9600, SerialPort.DATABITS_8,SerialPort.STOPBITS_1 ,SerialPort.PARITY_NONE );
mySC= new Scanner(mySP.getInputStream());
myPS = new PrintStream (mySP.getOutputStream());
while(!mySC.hasNextInt())
{
mySC.close();
mySC= null;
mySC= new Scanner(mySP.getInputStream());
}
int valor = mySC.nextInt();
myPS.println("hola");
}
}