Go Down

Topic: Small SDCard library (Read 11691 times) previous topic - next topic

rokeefe

I am using Pin (2) as my chip select pin and change the first line in the demo code to:

const uint8_t CHIP_SELECT = 2;


I also added pinMode to 10.


  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);
 
  if (!card.init(0, 2)) {
    PgmPrintln("card.begin failed");
    sdError();
    return;
  }

I keep getting the following error:

Fat16 version: 20140806
FreeRam: 1270

type any character to start
card.begin failed
SD error
errorCode: 2
errorData: 1

type any character to start


Any help would be appreciated?

elevi

Hello,

My program is to big(22.5Kb) so I can't use the arduino SD.h library and i want to try fat16.h.
I downloaded the "Smaller FAT16 only library for Arduino" from here https://github.com/greiman/Fat16 but i get compilation error for the example files (fat16write,fat16read,fat16AnalogLogger...).
I`m using Arduino 1.0.6 and an arduino uno bord with this type https://s15.postimg.org/kfxyhv23f/microsd_breakout_board.jpg of SD card reader.
2GB uSD card formated FAT16.

i get this compilation error:
Quote
fat16write.ino: In function 'void setup()':
fat16write:50: error: 'class SdCard' has no member named 'begin'
What can i do to resolve the compilation problem?

PaulS

Quote
What can i do to resolve the compilation problem?
Are you sure that you don't have another library of the same name? The SdCard class does have a method called begin().
The art of getting good answers lies in asking good questions.

elevi

Quote
Are you sure that you don't have another library of the same name?
I search on my computer for "Fat16.h" and i found in two location:
  • ...\My Documents\Arduino\libraries\Fat16-master\Fat16
  • ...\Program Files\Arduino\libraries\Robot_Control

I deleted the Robot_Control folder and after I try to compile the fat16write.ino and i get these errors:


fat16write:12: error: 'SdCard' does not name a type
fat16write:13: error: 'Fat16' does not name a type
fat16write.ino: In function 'void error_P(const char*)':
fat16write:19: error: 'PgmPrint' was not declared in this scope
fat16write:20: error: 'SerialPrintln_P' was not declared in this scope
fat16write:21: error: 'card' was not declared in this scope
fat16write.ino: In function 'void writeNumber(uint32_t)':
fat16write:40: error: 'file' was not declared in this scope
fat16write.ino: In function 'void setup()':
fat16write:46: error: 'PgmPrintln' was not declared in this scope
fat16write:50: error: 'card' was not declared in this scope
fat16write:53: error: 'Fat16' has not been declared
fat16write:53: error: 'card' was not declared in this scope
fat16write:63: error: 'file' was not declared in this scope
fat16write:63: error: 'O_CREAT' was not declared in this scope
fat16write:63: error: 'O_EXCL' was not declared in this scope
fat16write:63: error: 'O_WRITE' was not declared in this scope
fat16write:65: error: 'file' was not declared in this scope
fat16write:66: error: 'PgmPrint' was not declared in this scope
fat16write:71: error: 'file' was not declared in this scope
fat16write:78: error: 'file' was not declared in this scope

PaulS

I suspect that you'll learn more if you enable verbose mode when compiling.

I suspect that you'll want to rename the library folder to remove the -master crap.
The art of getting good answers lies in asking good questions.

Go Up