data logging with arduino (logomatic clone)

Dear all,

Below is a code to use an arduino instead of sparkfun's logomatic (Logomatic v2 Serial SD Datalogger - WIG-10216 - SparkFun Electronics) for data logging. During the setup, the arduino reads a text file Config.txt on the sd card, in which you may write

samplingrate = 1.0
filename = mpsn
A0 = 0
A1 = 1
A2 = 1
A3 = 1
A4 = 0
A5 = 0
A6 = 0
A7 = 0
Avcc = 1
Atemp = 1
D2 = 0
D3 = 0
D4 = 0
D5 = 0
D6 = 0
D7 = 0
D8 = 0
D9 = 0

This means that acquisitions on A1, A2 and A3 will be performed at a rate of 1 sample per second. The arduino's supply voltage and internal temperature will be also recorded. Data are stored in files mspn0.txt, mpsn1.txt, mpsn2.txt, ...

If connected to a computer (at a rate of 115200 bauds), the following lines will appear in the terminal:

Program start
SD Card ok, loading config.txt file
sampling rate = 1.000
Name of the data file: MPSN
A0=0
A1=1
A2=1
A3=1
A4=0
A5=0
A6=0
A7=0
Avcc=1
Atemp=1
D2=0
D3=0
D4=0
D5=0
D6=0
D7=0
D8=0
D9=0
Configuration loaded, closing config.txt file.
Number of columns : 5
Number of lines : 27
Time between two acquisitions :1000 ms
28119
Writing file : beginning, end

A LED should be connected to pin 9 (LedPin), to check that the data logger is alive. Interrupts are used for a regular sampling. Messages can be either in french or in english. Other languages are possible, your contributions are welcome !

The code can be found at http://www.univ-nantes.fr/auger-f, section "informations complementaires",
last line (data logging with arduino (logomatic clone)).

Hope this helps