Created
January 16, 2015 13:19
-
-
Save TomMinor/0b6cf6b93f3f3c3c8cfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(Serial.available() >= 4) | |
{ | |
Header = Serial.read() | |
// check header | |
PacketInfo = Serial.read(); | |
Payload = Serial.read(); | |
Footer = Serial.read(); | |
while(Serial.available()) | |
{ | |
Serial.read(); // Flush extra bytes | |
} | |
Byte chksum = generateCheckshum(Header, PacketInfo, Payload, Footer); | |
Serial.write(chksum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment