Read file content from Sd-card Module

Discussion in 'Programmer's Corner' started by Drk_alien, Jun 13, 2013.

  1. Drk_alien

    Thread Starter New Member

    Feb 28, 2013
    14
    0
    Hi guys,
    Can anyone help me with this? i need to read line by line from txt file using microC mmc library.
    The txt file is on my sd card, i'm using pic18f2580 to do this.
    My problem is that i don't know how to use "Mmc_Fat_Open" function.

    i tried to open the file "FILE.TXT" like this, but it seems that FILE_READ mode is not reconized and i think that fhandle is not corectly declared.
    errors: "Invalid expresion"
    "; expected, but 'short' found files.h "
    Code ( (Unknown Language)):
    1.  
    2. short fhandle;
    3. fhandle = Mmc_Fat_Open("FILE.TXT", FILE_READ, 0x01);
    4.  
    ps: my card is working properly, i can create file,create directories...etc.
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    The following code:
    Code ( (Unknown Language)):
    1. short fhandle;
    is itself declaring fhandle as a short.

    If fhandle is also defined as something else in some header or such then a conflict will result.

    Just try renamaming fhandle. fhandle1 should be fine.
     
  3. Drk_alien

    Thread Starter New Member

    Feb 28, 2013
    14
    0
    Which is equivalent for fgets function in microC ?
    Or how i should read the content of the file?
    Why FILE_READ param is not reconized?

    thanks.
     
  4. Drk_alien

    Thread Starter New Member

    Feb 28, 2013
    14
    0
    Anyone?..help please ...! :D
     
Loading...