Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. oid parsing() {
  2. if (Serial.available() > 0)
  3. {
  4.  
  5. char incomingByte = Serial.read();
  6. if (getStarted)
  7. {
  8. if (incomingByte != ' ' && incomingByte != ';')
  9. {
  10. string_convert += incomingByte;
  11. } else {
  12. intData[index] = string_convert.toInt();
  13. string_convert = "";
  14. index++;
  15. }
  16. }
  17. if (incomingByte == '$')
  18. {
  19. getStarted = true;
  20. index = 0;
  21. string_convert = "";
  22. }
  23. if (incomingByte == ';')
  24. {
  25. getStarted = false;
  26. recievedFlag = true;
  27. }
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement