Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PanamaHitek_Arduino arduinouno = new PanamaHitek_Arduino();
- int i;
- String mensaje;
- SerialPortEventListener listener=new SerialPortEventListener()
- {
- @Override
- public void serialEvent(SerialPortEvent spe)
- {
- //DibujarPie();
- try
- {
- if (arduinouno.isMessageAvailable()==true)
- {//Si llega un valor
- mensaje=arduinouno.printMessage();
- System.out.println("-->"+mensaje);
- System.out.println("-->"+mensaje.length());
- if(mensaje.length()==12)
- {
- colocacionPanel2(mensaje);
- }
- mensaje="";
- }
- }
- catch (SerialPortException ex)
- {
- }
- catch (ArduinoException ex)
- {
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement