a guest Apr 18th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- static int TeamScore = 0;
- char incoming = (char)Serial2.read();
- if(incoming < 15) // chars under decimal 15 do not map to useful ASCII characters so we should be fine using them to send/receive pair scores
- TeamScore += ((int)incoming * 10); //According to the IDC document each pair detection is 10 points, so that's why the x10 is there.
- else if(incoming == 'S') //snitch
- TeamScore += 150;
- // insert else if for your pair's characters here
- //don't forget to account for the fact that is you are the one in your pair sending your pair score then you won't be receiving it into the loop above so you need to manually add it
RAW Paste Data