Please help with the code. Reading a file from flash memory. The file contains only 4 numbers in two lines: 254 128 and 0 127. The program must also read these 4 numbers: 254 128 0 127 This is what actually happens:
LittleFS Matrix Read Test
Volume size: 125 MByte
File opened successfully. Reading and sending data...
5053 5232 4950 5613 1048 3249 5055 1310
Data has been sent successfully.
Thanks in advance for the community's support.
while (file.available()) {
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
int byteValue = file.read(); // Reading one byte
Serial.print(byteValue);
}
// Serial.print(" "); // Separator between bytes for clarity
}
break; // End the loop once the data has been sent once
}
file.close();
Serial.println("\nData has been sent successfully.");
}