From here I think I understand the difference between Serial.write and Serial.print, but is it the same when writing to a file in a SD card for example. Does it mean that File.write saves bytes in the file instead of text?
1 Answer
The File class inherits from the Stream class, which in turn inherits from the Print class.
The Serial class inherits from the Stream class, which in turn inherits from the Print class.
print()
and write()
are defined by the Print class.
So yes, File.print() and Serial.print() are the same, as are File.write() and Serial.Write().