Description
utils/consoleSD.h
for dice-SD provides the following function (SD library) to your console application:
s_console_SD()
: which delivers the following commands- SD dir – lists the files on the SD card
- SD write <file><text line> – creates/writes a line in a file
- SD print <path/file> – prints out a file
- SD remove <path/file> – removes a file
Parameters
String s_console_string – String that holds the user command. Normally returned by s_console_routine() or a previous console function.
Returns
String : the user command or an empty String “” if the user command was recognised and processed by this function. (see of commands above)
Example Code:
#include "consoleLogin.h"
#include "utils/consoleSD.h"
void setup() {
console_init(&Serial);
}
void loop() {
String s_console_string = s_console_routine();
s_console_SD(s_console_string);
}
Notes and Warnings
This console-function and its commands are helpful to test and learn to work with the SD card file system and files. See the source code as example code for your own application:
C:\Users\yourName\AppData\Local\Arduino15\packages\dice\hardware\samc\1.0.0\libraries\Console\src\...
In a ‘real world’ application, the s_console_SD() functions should not be required but during development it could be helpful.
Please keep in mind that each included file and its used function increase the size of the resulting application. So in order to keep the application binaries as small as possible, include only functions that are really necessary for the final application.
An example can be found in the Arduino IDE menu:
File -> Examples -> Consoles ->
Dev_Console
See also
SD library