Go Down

Topic: Good way to detect that a SD card has been removed (Read 3384 times) previous topic - next topic

jcarrr

fat16lib

Well, that is straightforward, and it works perfectly.

I tried a lot of combinations, but I think I was stuck on Root, not root.

Thanks

Until the last version of SdFat I used either the Arduino published version of the interface or the MC version with perfect results while programming either UNOs or Duemilanoves.  Since the last version of SdFat the MC version has been unusable, this is typical output:


Code: [Select]

C \__arduino-0022MCa\hardware\tools\avr\bin\avr-g++    -c  -g  -Os  -w  -fno-exceptions  -ffunction-sections  -fdata-sections  -mmcu=atmega328p  -DF_CPU=16000000L  -DARDUINO=22  -DARDUINO=     -IC \___a_projects\Pump Controller\A9   -IC \__arduino-0022MCa\hardware\arduino\cores\arduino   -IC \___a_projects\libraries\SdFat   -IC \__arduino-0022MCa\.\libraries\Wire   -IC \___a_projects\libraries\RTClib   -IC \__arduino-0022MCa\.\libraries\EEPROM    c \___a_output\A9.cpp  -o  c \___a_output\A9.cpp.o
In file included from C:\___a_projects\libraries\SdFat/SdFile.h:24,
                 from C:\___a_projects\libraries\SdFat/SdFat.h:26,
                 from A9.cpp:30:
C:\___a_projects\libraries\SdFat/SdBaseFile.h:27:13: error: operator '<' has no left operand
C:\___a_projects\libraries\SdFat/SdBaseFile.h:30:21: error: Arduino.h: No such file or directory
In file included from A9.cpp:31:
C:\___a_projects\libraries\SdFat/SdFatUtil.h:27:13: error: operator '<' has no left operand
In file included from C:\___a_projects\libraries\SdFat/SdFile.h:24,
                 from C:\___a_projects\libraries\SdFat/SdFat.h:26,
                 from A9.cpp:30:
C:\___a_projects\libraries\SdFat/SdBaseFile.h:271: error: 'Print' has not been declared
C:\___a_projects\libraries\SdFat/SdBaseFile.h:285: error: 'Print' has not been declared
C:\___a_projects\libraries\SdFat/SdBaseFile.h:287: error: 'Print' has not been declared
C:\___a_projects\libraries\SdFat/SdBaseFile.h:360: error: 'Print' has not been declared
C:\___a_projects\libraries\SdFat/SdBaseFile.h:370: error: 'Print' has not been declared
In file included from C:\___a_projects\libraries\SdFat/SdFat.h:26,
                 from A9.cpp:30:
C:\___a_projects\libraries\SdFat/SdFile.h:32: error: expected class-name before '{' token
In file included from C:\___a_projects\libraries\SdFat/ArduinoStream.h:26,
                 from C:\___a_projects\libraries\SdFat/SdFat.h:28,
                 from A9.cpp:30:
C:\___a_projects\libraries\SdFat/bufstream.h: In member function 'void ibufstream::init(const char*)':
C:\___a_projects\libraries\SdFat/bufstream.h:49: error: 'strlen' was not declared in this scope
In file included from C:\___a_projects\libraries\SdFat/SdFat.h:28,
                 from A9.cpp:30:
C:\___a_projects\libraries\SdFat/ArduinoStream.h: At global scope:
C:\___a_projects\libraries\SdFat/ArduinoStream.h:40: error: expected `)' before '&' token
C:\___a_projects\libraries\SdFat/ArduinoStream.h:82: error: ISO C++ forbids declaration of 'Stream' with no type
C:\___a_projects\libraries\SdFat/ArduinoStream.h:82: error: expected ';' before '*' token
C:\___a_projects\libraries\SdFat/ArduinoStream.h: In member function 'void ArduinoInStream::readline()':
C:\___a_projects\libraries\SdFat/ArduinoStream.h:50: error: 'hw_' was not declared in this scope
C:\___a_projects\libraries\SdFat/ArduinoStream.h:53: error: 'millis' was not declared in this scope
C:\___a_projects\libraries\SdFat/ArduinoStream.h:54: error: 'hw_' was not declared in this scope
C:\___a_projects\libraries\SdFat/ArduinoStream.h:61: error: 'hw_' was not declared in this scope
C:\___a_projects\libraries\SdFat/ArduinoStream.h: At global scope:
C:\___a_projects\libraries\SdFat/ArduinoStream.h:95: error: expected `)' before '&' token
C:\___a_projects\libraries\SdFat/ArduinoStream.h:113: error: ISO C++ forbids declaration of 'Print' with no type
C:\___a_projects\libraries\SdFat/ArduinoStream.h:113: error: expected ';' before '*' token
C:\___a_projects\libraries\SdFat/ArduinoStream.h: In member function 'virtual void ArduinoOutStream::putch(char)':
C:\___a_projects\libraries\SdFat/ArduinoStream.h:103: error: 'pr_' was not declared in this scope
C:\___a_projects\libraries\SdFat/ArduinoStream.h:104: error: 'pr_' was not declared in this scope
In file included from A9.cpp:30:
C:\___a_projects\libraries\SdFat/SdFat.h: At global scope:
C:\___a_projects\libraries\SdFat/SdFat.h:61: error: 'Print' has not been declared
In file included from A9.cpp:31:
C:\___a_projects\libraries\SdFat/SdFatUtil.h:39: error: variable or field 'print_P' declared void
C:\___a_projects\libraries\SdFat/SdFatUtil.h:39: error: 'Print' was not declared in this scope
C:\___a_projects\libraries\SdFat/SdFatUtil.h:39: error: 'pr' was not declared in this scope
C:\___a_projects\libraries\SdFat/SdFatUtil.h:39: error: expected primary-expression before 'const'
C:\___a_projects\libraries\SdFat/SdFatUtil.h:40: error: variable or field 'println_P' declared void
C:\___a_projects\libraries\SdFat/SdFatUtil.h:40: error: 'Print' was not declared in this scope
C:\___a_projects\libraries\SdFat/SdFatUtil.h:40: error: 'pr' was not declared in this scope
C:\___a_projects\libraries\SdFat/SdFatUtil.h:40: error: expected primary-expression before 'const'
A9.cpp: In function 'void loop()':
A9:148: error: 'class SdFile' has no member named 'print'
A9.cpp: In function 'void file_head_stamp()':
file_functions:91: error: 'class SdFile' has no member named 'println'
A9.cpp: In function 'void file_setup_stamp()':
file_functions:100: error: 'class SdFile' has no member named 'print'
file_functions:104: error: 'class SdFile' has no member named 'print'
file_functions:107: error: 'class SdFile' has no member named 'print'
file_functions:110: error: 'class SdFile' has no member named 'println'
file_functions:113: error: 'class SdFile' has no member named 'print'
file_functions:118: error: 'class SdFile' has no member named 'println'
file_functions:123: error: 'class SdFile' has no member named 'println'


cannot find a general discussion of the problem.  Is it just my installation or is this a problem for others?


Thanks for the help. The cards can now be pulled and inserted at any time.

John C

fat16lib

Looks like the "MC version" does not define the ARDUINO macro.  I have been using it to make mods to support both 0022 and the new Arduino 1.0.

This appears to fail in the MC version:
Code: [Select]
#if ARDUINO < 100
#include <WProgram.h>
#else  // ARDUINO
#include <Arduino.h>
#endif  // ARDUINO

Go Up