Tag Archives: Flash Memory

Logging Data On Your Raspberry Pi Pico Using Flash Memory

In this video lesson, We show you how to log sensor data on your Raspberry Pi Pico W. We will start with simple read and write functions, and then show you how to write and read files line by line, and keep a log of your sensor data.

Our first program is very simple, and just shows how to write a line of data, and read a line of data the the Pico’s flash memory. Here is the code we used in the video for the first simple example.

In the second example, we show greater complexity by writing and reading a file, line by line. Each line contains comma delimited sensor data.

In these first two examples, when we open the file as ‘w’, the existing data is erased and a new file is created. In the example below, we open an existing file, and show how to append new data to the existing file without erasing the old data.