The File.write() function writes data to the file.
The File.write() function inherits from the Stream utility class.
- file: an instance of the File class that is returned by SD.open()
- data: the byte, char, or string (char *) to write
- buf: an array of characters or bytes
- len: the number of elements in buf
- Returns the number of bytes written
After running the above code, if you disconnect SD Cart from Arduino and connect the SD Card to your your PC, you will see a arduino.txt file with the below content