Description
I spent some time writing a tool to make it easier to get your images onto the Arduboy.
It is similar to MrBoggieMan’s tool that takes an image in and generates the 1-bit hex array that Arduboy can use to render in drawSlowXYBitmap function.
I’ve tested on my Dev Kit but for demonstration purposes, I used Arduboy in Javascript
(I used MrBoggieMan’s Arduboy in Javascript to demonstate. Thanks MrBoggieMan!)
Features
- Takes PNG, JPG, GIF and BMP
- Allows to filter by Alpha, R, G or B channel
- Invert output
- Original Image (resampled if needed) and converted image preview
- If the image is larger than 128 px wide or 64 tall, the image will be resampled
- Generates code for 1 bit encoded hex byte array with the dimensions in the file name: FileName_(Width)_(Height) for easy calling drawSlowXYBitmap
Instructions / Download
-
Download and install Mono Framework:
http://www.mono-project.com/download/
(You must run this application using the Mono Command Line) -
Download Image 2 Arudoby:
http://www.excidiumgamedev.com/sdm_downloads/image2arduboy/
(I’d like to track stats!) -
Unzip Image 2 Arduboy
-
Execute using command line: $ mono ImageToArduboy.exe
-
Load your image
-
Set your threshold values
-
Copy the code into your IDE:
arduboy.drawSlowXYBitmap(0, 0, mario_64_64, 64, 64, 1);
(See that the file name contains the dimensions of the image so you can pass them into the function)
- Run your program on the Arduboy
Version 0.1
-Known Issues:
- I know that some images cause crashes. Please post those images so I can have some cases to debug. Image processing is hard!
- File names with spaces keep the spaces in the code generated. When I attempted to fix this, Xamarin would crash on a simple removal of space in the string. Will update when stable.
- Only generates hex array for drawSlowXYBitmap currently since drawBitmap vertically within pages across columns as I understand it
- Stand alone .exe execution in windows will do nothing. The program will hang and not show up in task manager. If you find the process and try to kill it, it does nothing. Does anyone know how to fix this? I spent nights trying to get this to stop happening. Mono command line is the only way to run the program.
- Copy and Pasting the text from the application directly into Arduino IDE causes some odd java exception. I’m actively trying to figure out what this is and in the mean time, just paste the text somewhere else, copy and then paste back into the Arduino IDE.
About
I’ve coded a lot of games in lots of environments but I’ve never written a traditional application. This was an exercise to increase my knowledge and programming prowess. I also wanted another code sample in my portfolio.
I use GTK# 2.0 in Xamarin Studio. The application seems deceptively simple but it was not straight forward to work with the GTK# framework. Open source is great, but it comes with its thorns. Big sharp thorns. I wanted it to be multi-platform but GTK and Xamarin left me with a bad taste in my mouth. The logic of what I wanted was done in a few nights but I spent 4 times that fighting GTK, GDK and Xamarin itself. In the end if I could not generate an executable that would run in .Net on windows. Mono command line was the only option. I look forward to finding someone to talk to about that. (If someone would like to discuss why the executable is fine in Xamarin on OS X, but on Windows only Debug build works, I’d be game!) If I try to execute the app by double clicking on it, the application doesn’t open any window, the file locks in the System and cannot be killed, stopped or deleted.
Please leave feedback, comments, bugs or if you find the tool useful! Thanks!