Uploading file data as a C Header

If you have a micro-controller and need to use some data from a file (say a static HTML web page or a bitmap) and you dont have a file system then you need to convert the file into a C Header file.

In Unix there are a lot of command lines to do this but in Windows I could not find an easy and non-dodgy way so I wrote a little open source Lazarus program to do this (if you read my last post you will understand why)

Operation is simple. Run the program, choose your file. Any file (up to 10MB) will be accepted, select your output header filename and press go. and in the above scenario it produces the listing below

To compile open in lazarus (the pas file will also compile in delphi but you will need to create a new project and form and drop them on as the delphi form is saved differently)  and press compile. – Seriously its not rocket science.

Zipped exe and source code here => Create_C_Header_From_file_Project and EXE

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.