Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void serialEvent (DummySerialPortEvent event)
- {
- String temp = "";
- if (event.getEventType() == DummySerialPortEvent.DATA_AVAILABLE)
- {
- try
- {
- String temp1, temp2, temp3, temp4;
- while (input.available() > 0)
- {
- int character = input.read();
- temp +=(char)character;
- }
- addDebugTekst(temp);
- temp1 = temp.substring(0,temp.indexOf("cb")-1);
- temp2 = temp.substring(temp.indexOf("cb"),temp.indexOf("cc")-1);
- temp3 = temp.substring(temp.indexOf("cc"),temp.indexOf("cd")-1);
- temp4 = temp.substring(temp.indexOf("cd"));
- if(temp1.substring(3,4).equals("-"))geefWaarde(Float.valueOf(temp1.substring(3,8)).floatValue()); // Kijk of het een negatief getal is
- else geefWaarde(Float.valueOf(temp1.substring(3,7)).floatValue());
- if(temp2.substring(3,4).equals("-"))geefWaarde2(Float.valueOf(temp2.substring(3,8)).floatValue()); // Kijk of het een negatief getal is
- else geefWaarde2(Float.valueOf(temp2.substring(3,7)).floatValue());
- if(temp3.substring(3,4).equals("-"))geefWaarde3(Float.valueOf(temp3.substring(3,8)).floatValue()); // Kijk of het een negatief getal is
- else geefWaarde3(Float.valueOf(temp3.substring(3,7)).floatValue());
- if(temp4.substring(3,4).equals("-"))geefWaarde4(Float.valueOf(temp4.substring(3,8)).floatValue()); // Kijk of het een negatief getal is
- else geefWaarde4(Float.valueOf(temp4.substring(3,7)).floatValue());
- }
- catch(IOException e) {}
- }
- }
Add Comment
Please, Sign In to add comment