diff --git a/Makefile b/Makefile index 7e1f898..f47f1fe 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,6 @@ -default: - g++ -Wall -g -std=c++11 -o bin2csv main.cpp +output: main.o + g++ -Wall -g -std=c++11 main.o -o bin2csv +main.o: main.cpp + g++ -Wall -g -std=c++11 -c main.cpp +clean: + rm *.o bin2csv diff --git a/README.md b/README.md index 042b531..c890b28 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # bin2csv convert binary files from SdFat AnalogBinLogger to csv files on an pc (x64). - +https://github.com/greiman/SdFat/tree/master/examples/AnalogBinLogger compile with: cd bin2csv diff --git a/main.cpp b/main.cpp index 61bd3ef..fa75d29 100644 --- a/main.cpp +++ b/main.cpp @@ -1,3 +1,22 @@ +/*/////////////////////////////////////////////////////// + +bin2csv is to convert binary files produced by SdFats +"AnalogBinLogger" + +https://github.com/greiman/SdFat/tree/master/examples/AnalogBinLogger + +compile: +# cd bin2csv +# make + +To run the conversion just supply +bin2csv with an input binary file and an output csv file. +(tested only on x64 linux). +I am a c++ beginner so errors are likely + +////////////////////////////////////////////////////////*/ + + #include #include #include @@ -154,6 +173,7 @@ int main ( int argc, char* argv[] ) std::cerr << "Usage: \t" << argv[0] << " input.bin output.csv\n"; break; case 2: + iFileName = argv[1]; std::cerr << "ERROR, no output file specified!\n"; break; case 3: