Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy 3.6: Standard SD or SdFat library?

  1. #1

    Teensy 3.6: Standard SD or SdFat library?

    Hi guys,
    I'm porting my Arduino MEGA project to the Teensy v3.6 board and on Arduino I've used SdFat library beacuse it seems much fast and light than the SD lib...
    What about SD lib on Teensy 3.6? Do you suggest me to use SD or SdFat lib?
    If SdFat is the best way... which pin have I to use in the begin method?

  2. #2
    Member
    Join Date
    Mar 2019
    Location
    Bordeaux / France
    Posts
    69
    I'm coding a small shell utility and soon switched from SD to SdFat without problems... On teensy you only have to

    #include <SdFat.h>

    and declare variables as

    Sd2Card card;
    SdFatSdio sd;

    Then no pin on begin

    Code:
    if (!sd.begin()) {
                term->println("sd begin error");
            }

  3. #3
    Thanks!

    What is the best why with SdFat to remove all the files in a specific folder?
    Is it possible to retrieve the newes file contained in a folder considering that the file has been created with the date like 20190509121300.log?

  4. #4
    Member
    Join Date
    Mar 2019
    Location
    Bordeaux / France
    Posts
    69
    SdFat provides all the call needed to iterate a directory, and for each entry you can check its type (file or dir) and its attributes (date, etc) then decide to delete the file or not - But you have to write the code for this yourself, have a look at the examples...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •