-
-
Save anonymous/301c8ccb12d92cddfa11d8d93e784937 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
} | |
else | |
{ | |
// Looks like the serial data starts with a valid Start of Text character, | |
// let mark that we detected a potential tag. | |
tagDetected = true; | |
// Go and process the tag in the serial1 buffer. | |
fetchTagData(ourTag); | |
// NOTE: The fetchTagData function actually alters the ourTag array | |
// declared earlier before. Nothing is returned because if an array's name | |
// pass along into a function, it is actually passing by reference, not by | |
// value. That means we are changing the array's contents in the function | |
// so nothing needs to be returned! There are other spots in this program | |
// where this happens so please keep this in mind. | |
// While we're at it, why not print out the tag's ID. | |
Serial.print("Your tag says it is: "); | |
Serial.flush(); | |
printTag(ourTag); | |
} | |
Now, see if you think this format might be easier to read: | |
} else { | |
// Looks like the serial data starts with a valid Start of Text character | |
tagDetected = true; // Flag that we detected a potential tag. | |
fetchTagData(ourTag); // Go and process the tag in the serial1 buffer. | |
/* | |
NOTE: The fetchTagData function actually alters the ourTag array | |
declared earlier before. Nothing is returned because if an array's name | |
pass along into a function, it is actually passing by reference, not by | |
value. That means we are changing the array's contents in the function | |
so nothing needs to be returned! There are other spots in this program | |
where this happens so please keep this in mind. | |
*/ | |
Serial.print("Your tag says it is: "); // While we're at it, why not print out the tag's ID. | |
Serial.flush(); | |
printTag(ourTag); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment