Skip to content

Instantly share code, notes, and snippets.

@Tech500
Last active September 3, 2022 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tech500/b05c2d9837952a926f09e31a1e2a618f to your computer and use it in GitHub Desktop.
Save Tech500/b05c2d9837952a926f09e31a1e2a618f to your computer and use it in GitHub Desktop.
// 09/03/2022 @ 04:35 Able to read List of 10 words
// How to print third word in list?
void readWord(){
// Open a "wordfile.txt" for reading
File word = LittleFS.open("/wordfile.txt", "r"); //input words from "wordfile.txt"
if (! word){
Serial.println("File 'wordfile.txt' open failed");
}
while(word.available()) {
for(wordCount; wordCount < 10; wordCount++) { //Build an arrary of words
inputWord[wordCount] = word.readStringUntil('\n');
Serial.println(inputWord[wordCount]);
}
word.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment