This recipe will show you how to write data to an output file. We will cover how to write strings, as well as bytes, to a file. We will then define a type of object to make it easier to perform these common operations of writing text and binary data to files. If you want to create a project that saves sensor data to a log file or records some user-generated data to the board's storage, then you will need to use many of the techniques we'll describe in this recipe.
Writing a file's contents
Getting ready
You will need access to the REPL on Circuit Playground Express to run the code presented in this recipe. Make sure that you've completed the Remounting the filesystem recipe in this chapter as this recipe...