I'm using an Arduino Yun to read from a datafiledata file, which will then populate a data structure. The file.read() function "returns: The next byte (or character), or -1 if none is available."
This functionality is identical to the SD.read() function in the SD card library.
The datafiledata file will never have any value whichthat exceeds 1 byte with all numbers in the range 0-2550-255. If I print these numbers as a long string in the datafiledata file, each character is read as a byte. So I need to call file.read() 3 times to read in a single 0-2550-255 value. And then do some additional processing to construct the final 8-bit value for storing.
I could reduce this to 2 calls by printing the Hex Codecode in the datafiledata file, but this isn't much of an improvement.
Is there a way to encode a full byte in a single character?
Effectively , is there a particular way I can format my datafiledata file so that I can read in an 8-bit unsigned value in a single call to file.read()?