I'm trying to read from file by using file system in RPI Pico and I follow these steps:
* Download the tool: https://github.com/earlephilhower/arduino-pico-littlefs-plugin/releases
* In your Arduino sketchbook directory, create `tools` directory if it doesn’t exist yet.
* Unpack the tool into `tools` directory (the path will look like `<home_dir>/Arduino/tools/PicoLittleFS/tool/picolittlefs.jar`) If upgrading, overwrite the existing JAR file with the newer version.
* Restart Arduino IDE.
* Open a sketch (or create a new one and save it).
* Go to sketch directory (choose Sketch > Show Sketch Folder).
* Create a directory named `data` and any files you want in the file system there.
* Make sure you have selected a board, port, and closed Serial Monitor.
* Double check theSerial Monitor is closed. Uploads will fail if the Serial Monitor has control of the serial port.
* Select `Tools > Pico LittleFS Data Upload`. This should start uploading the files into the flash file system.
And this is my code :
#include "LittleFS.h" // LittleFS is declared
void setup()
{
Serial.begin(115200);
while (!Serial)
// LittleFS.begin();
File root = LittleFS.open("/");
File file = root.openNextFile();
while(file) {
for(int i=0;i<100;i++){
String str = file.readStringUntil('\n');
arr[i] = str.toFloat();
}
file.close();
}
void loop()
{
}
My problem I get on this error when I run the code! why?
LittleFS.h: No such file or directory
I use Arduino IDE 1.8.116
RPi Pico2040