Schupp

Untitled

Sep 18th, 2021
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. int readycount = 0;
  2. String inputString = "";
  3.  
  4. void serialEvent() {
  5. while (Serial.available()) {
  6. // get the new byte:
  7. String suche = "SYN";
  8. char inChar = (char) Serial.read();
  9. if (inchar == suche.charAt(readycount))
  10. readycount++;
  11. else
  12. readycount = 0;
  13.  
  14. if (readycount > 0)
  15. inputString += inChar;
  16. if (readycount > suche.length() - 1) {
  17. match = true
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment