Read file content from Sd-card Module

Thread Starter

Drk_alien

Joined Feb 28, 2013
14
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 "
Rich (BB code):
short fhandle;
fhandle = Mmc_Fat_Open("FILE.TXT", FILE_READ, 0x01);
ps: my card is working properly, i can create file,create directories...etc.
 

ErnieM

Joined Apr 24, 2011
8,377
The following code:
Rich (BB code):
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.
 

Thread Starter

Drk_alien

Joined Feb 28, 2013
14
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.
 
Top