Code Monkey home page Code Monkey logo

sdterminal's Introduction

SdTerminal

GitHub version arduino-library-badge

Basic terminal interface for Arduino SD card logging/file management. Allows basic file management of an SD card with an Arduino through serial commands.

Commands:

For more information on a specific command, type help command-name
> - Create file if it doesn't already exist
ap - Append a line to an existing file
cd - Change present working directory
cp - Copy a file to another location
echo - Turn on or off echoing user commands
help - Provide info on commands. Can specify a specific command for help
ls - List the contents of the card. Can specify a specific dir for listing
mkdir - Make a new directory at a specific location
mv - Move or rename a file
print - Print the contents of the given file
pwd - Print the present working directory
rm - Remove a file or dir

Notes:

The returned message ? signifies the last command was invalid

Example Sketch

#include "SdFat.h"
#include "SdTerminal.h"


// Uncomment 'USE_EXTERNAL_SD' define to use an external SD card adapter or leave
// it commented to use the built in sd card.
//#define USE_EXTERNAL_SD 

#ifdef USE_EXTERNAL_SD
const uint8_t SD_CS_PIN = SS;
#define SPI_CLOCK SD_SCK_MHZ(10)
#define SD_CONFIG SdSpiConfig(SD_CS_PIN, SHARED_SPI, SPI_CLOCK)
#else // Use built in SD card

#ifdef SDCARD_SS_PIN
const uint8_t SD_CS_PIN = SDCARD_SS_PIN;
#endif // SDCARD_SS_PIN
#define SPI_CLOCK SD_SCK_MHZ(50)
#define SD_CONFIG SdioConfig(FIFO_SDIO)
#endif // USE_EXTERNAL_SD


SdFs sd;
Terminal myTerminal;


void setup()
{
  Serial.begin(115200);
  
  while (!sd.begin(SD_CONFIG))
  {
    Serial.println("SD initialization failed\n");
    delay(1000);
  }
  Serial.println("SD initialization succeeded\n");
  
  myTerminal.begin(sd);
}


void loop()
{
  myTerminal.handleCmds();
}

sdterminal's People

Contributors

powerbroker2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

isabella232

sdterminal's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.