Pages: [1]   Go Down
Author Topic: Looking help for opening SD file from LCD screen!!  (Read 969 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

First thank you for reading my post. I'm working on a project that involves communication between LCD, SD card using arduino.
The task includes displaying the files stored in the SD card on the LCD screen, then opening the file and send it to the arduino.

Since I don't have much experience with arduino, so what I did was modifying the SDFile.ls() and SDFile.printDirName() function such that they jam all the file name into one single string. The file names is then extracted from this string (based on the pattern of the string) and stored into an array. So I have the file names (8.3 format) and display it on the LCD screen. Because I failed to extract the path of the file name, I can only open the files that is in the root, and only the first file in each subdirectory.

I would greatly appreciate any help to get the file name to display on the LCD screen and the path to open it. What I did may not be the right method, can anyone give me some guidance. Thank you very much.

Eric D

Here is what it looks like from Serial.print();
//Output from calling SDFile.ls():
AATXT~1.TXT
AA2TXT~1.TXT
A1/
  ANOTHE~1.TXT
  SS1.TXT
AA3.TXT
AA4GCO~1.TXT

//Those name is store into this string,( the pattern made it hard to extract the path name for each file, I think)
00AATXT~1.TXT0AA2TXT~1.TXT0A1/00ANOTHE~1.TXT0SS1.TXT0AA3.TXT0AA4GCO~1.TXT

//The string is then store into this array
AATXT~1.TXT
AA2TXT~1.TXT
A1/ANOTHE~1.TXT
SS1.TXT //***this file doesn't has a path
AA3.TXT
AA4GCO~1.TXT






Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1550
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I am working on this topic since some time. My goal is to display the SD card file structure on a display:



This will not display the entire file structure but will allow navigation through the directory structure with two or more external buttons.

The file selection box is based on the m2tklib user interface library. The description for the m2tk file selection box is already online: http://code.google.com/p/m2tklib/wiki/fileselectbox. Everything will be available with the next m2tklib release.

Together with the LiquidCrystal port of m2tklib, this file selection box is also available for character displays (without icons on the left side). A lot of LCD and OLED displays are supported by the combination of m2tklib and u8glib (see the device list here: http://code.google.com/p/u8glib/wiki/device), but also GLCDv3 and m2tklib will work together.

After selection of a file, the full pathname is avilable within the Arduino: http://code.google.com/p/m2tklib/wiki/mas#mas_GetPathFilename. The result can be used to open a file for reading or writing.
M2tklib and the mass storage subsystem (will be part of the next m2tklib) currently support the SD lib, SdFat lib and the Petit Fat File System lib.

Maybe you can specify your sd-card library and the intended display for a more precise answer. I can also offer a pre-release of m2tklib.

Oliver





Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1550
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

M2tklib with the file selection box is now available for download.
http://code.google.com/p/m2tklib/downloads/list

Supported fat file system libraries are:
  • Arduino SD
  • SdFat
  • Petit File System (read only version included with M2tklib)

M2tklib will work with a large range of displays. All displays, supported by the following libraries, can be used:



Oliver
« Last Edit: July 12, 2012, 02:04:47 pm by olikraus » Logged

Pages: [1]   Go Up
Jump to: