antumdeluge / bin2header Goto Github PK
View Code? Open in Web Editor NEWBinary file converter to C/C++ source header
License: MIT License
Binary file converter to C/C++ source header
License: MIT License
Add a fewoptions to make tool more usefull:
-add option to start with an offset and for only given length
-add option to pack data into 16/32 bit word (and swap endianess if needed)
I have a series of files called things like 36.bin
- bin2header will generate an array called 36 with #defines for 36_H. Neither of those are valid names.
It should really know what a valid C identifier looks like to warn you. Or perhaps allow the user to supply a name on the command line? Or add a prefix (e.g. DATA) to the front of names starting with a digit?
A comment at the end of any line should show the containing data as ascii chars (dot for not printable chars).
i am new to these kind of stuff but i can't get it to run yesterday i waisted 3 hours on this and today already 2 and i can't get my grasp on what it is i downloaded this git and also the sourceforge version.
:(
greeting
marc
As reported by a user, it appears that bin2header has a limit on how large of a file it can handle. This limitation may be different depending on operating system & available system resources. I have mostly tested the program with image files, & probably nothing bigger (at most) than a couple megabytes. It appears that when the program attempts to load a file larger than it can handle, it crashes without any helpful information about the error.
There are two things that I want to do:
First, have the program recognize when it cannot handle a file due to size limitations & output error details for the user without crashing.
Second, I want to increase, or perhaps abolish, the limitation on file size. Off-hand, I think a solution would be to set a chunk size for the program to process at a single time, rather than attempting the load the entire file all at once. Perhaps this chunk size could be manually adjusted by the user.
Original issue on SourceForge: https://sourceforge.net/p/bin2header/tickets/1/
I'm trying to convert a BMP in 128x32 size
for use a custom Adafruit splash screen .
Example https://github.com/adafruit/Adafruit_SSD1306/tree/master/examples/ssd1306_128x32_i2c
replace const uint8_t PROGMEM splash2_data[] in /home/youruser/Arduino/libraries/Adafruit_SSD1306/Splash.h
I got a distorted pixel mesh .
Original splash :
const uint8_t PROGMEM splash2_data[] = { 0b00000000,0b00000000,0b01100000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000, 0b00000000,0b00000000,0b11100000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
Updated from what I got from bin2header :
const uint8_t PROGMEM splash2_data[] = { 0x42, 0x4d, 0x8a, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x04, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x23, 0x2e, 0x00, 0x00, 0x23, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.