My freeware tools for Arduboy development

Hello to the Arduboy community !

Awaiting for my Arduboy, hopefully in October :wink: I wrote a collection of small stand-alone utilities that I think can help with development of Arduboy games/apps.

I made a dedicated section, where they can be downloaded, on my website : http://mougino.free.fr (last section: “Arduino”)

The interesting ones for the Arduboy are :

  • a flexible color --> b&w image converter (3 modes of operation: single image, batch, command-line)
  • a b&w image <–> C++ array converter (single image/table, or batch mode)

These tools are small-sized and do not require any framework to work (Java, .Net or any other). They were written for Windows but run as well on Unix systems with the help of Wine.

Feel free to give me feedback if you’d like to see improvements, or if you have ideas for other utilities :wink:

Cheers,
Nicolas

3 Likes

I tested Paintuino on Mac OS 10.10 with the following 3x5 px image and it seems to pad it nicely to 40 bytes (8x5 px).

Would it be possible to export images with vertical byte orientation? I don’t know if it is due to the Adafruit SSD1306 library or to your program, but the following code makes the image appear rotated 90° counterclockwise.

#include <SPI.h>
#include <EEPROM.h>
#include "Arduboy.h"

Arduboy arduboy;

PROGMEM const unsigned char f[] =
{
  //3,5,
  0xE0, 0x80, 0xC0, 0x80, 0x80,
};

void setup()
{
  arduboy.start();
  arduboy.clearDisplay();
  arduboy.drawBitmap(0, 0,  f, 5, 3, WHITE);
  arduboy.display();
}

void loop() {}

Hi David, sure thing ! Can you confirm that the Paintuino image is rotated +90° clockwise once rendered on the Arduboy ?
In this case I will propose an option to create a -90° clockwise-rotated table.

Nicolas

Hello David, I released a v0.2 of Paintuino at the same place, with a 90° rotate option:
http://mougino.free.fr/arduino/#paintuino

Can you test it and tell me how it goes ?

Thanks,
Nicolas

It seems nearly right, but the image is padded on top instead of on the bottom. In other words, Paintuino 0.2 produces this:

Instead of this:

Also, the interface could be clearer about what this “rotate 90°” function means. For example, “Gamebuino format” and “Arduboy format” with the Arduboy aspect ratio rotated correctly. You can have a look at the nomenclature of LCD Assistant or from Bitmap2LCD.

Thanks for the precious feedback David !

You will find a v0.3 of Paintuino at http://mougino.free.fr/arduino/#paintuino with now correctly padded Arduboy tables and a new Gamebuino/Arduboy format option instead of the previous “rotate 90°” checkbox.

I also made some small fixes and improvements on the graph zone: you can left-click anywhere in the graph zone to hide/display the dotted lines, or right-click (after an image was loaded / generated from a table) to copy the image to the clipboard or save it as a 1-bpp bitmap.

Nicolas

Nice work guys! We are will eventually get a “Tools” section on our website once we can get around to making an update!

@mougino I have a problem with the following 52x50 image. It loads up fine but the code outputted doesn’t work. Could you check what the problem is?

By the way, the image works fine in LCD Assistant (except of course that LCD Assistant doesn’t pad images to 8-bit).

Hello David, what do you mean by the code doesn’t work ? Can you give details ? (And also on where it loads up fine ? in Paintuino or on the Arduboy ?)
I don’t have any Arduboy dev kit to test it on… My first tests in Paintuino v0.3 show consistency in the png and the array. Also, pasting the array in an empty Paintuino and clicking “Bitmap <-- Code” shows the initial image as expected.

Thanks for your feedback,
Nicolas

You don’t really need the Arduboy to test images, you just need an SSD1306 or Sh1106 screen. I modified the image so that it is now 52x56 and should produce the same code with Paintuino and LCD Assistant. The result is that the image loads up fine in Paintuino but the code produced doesn’t work on the Arduboy and is not the same as LCD Assistant.

Array generated by Paintuino:

PROGMEM const unsigned char paintuino[] = { /*56,52,*/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,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x00,0x00,0x00,0x0E,0x23,0xE0,0x00,0x00,0x00,0x00,0x31,0x43,0xC0,0x00,0x00,0x00,0x00,0x40,0x83,0x00,0x00,0x00,0x00,0x00,0x80,0x82,0x00,0x00,0x00,0x00,0x01,0x01,0x84,0x00,0x00,0x00,0x00,0x01,0x00,0x88,0x00,0x00,0x00,0x00,0x01,0x10,0x8F,0x80,0x1E,0x00,0x00,0x01,0xF0,0x00,0xC0,0x61,0xC0,0x00,0x00,0x08,0x00,0x41,0x80,0x30,0x00,0x00,0x08,0x00,0x23,0x00,0x0F,0xFE,0x00,0x04,0x00,0x16,0x00,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00,0x08,0x00,0x02,0x00,0x08,0x00,0x00,0x18,0x00,0x02,0x00,0x00,0x60,0x00,0x10,0x00,0x01,0x00,0x01,0xF0,0x70,0x20,0x00,0x02,0x00,0x03,0xF9,0xF8,0x20,0x00,0x04,0x06,0x07,0xFD,0xFC,0x20,0x00,0x08,0x1E,0x0F,0xFB,0xFC,0x20,0x00,0x10,0x3F,0x0F,0xFA,0x78,0x20,0x00,0x20,0x7E,0x1E,0x1B,0xF0,0x20,0x00,0x40,0x9E,0x1D,0xED,0xE0,0x20,0x00,0xC1,0x0C,0x3B,0xDC,0x00,0x20,0x00,0x82,0x08,0x7B,0xDC,0x00,0x20,0x01,0x04,0x10,0xF7,0xBC,0x00,0x20,0x01,0x08,0x21,0x37,0xB8,0x00,0x10,0x01,0x10,0x42,0x37,0x70,0x00,0x08,0x01,0x10,0x42,0x3B,0x70,0x08,0x0C,0x02,0x10,0x21,0x3B,0x70,0x3E,0x06,0x02,0x10,0x21,0x3B,0x7C,0xFE,0x3E,0x02,0x10,0x10,0xBD,0x7D,0xFC,0xC0,0x02,0x10,0x10,0x9E,0x7D,0xBD,0x00,0x02,0x20,0x09,0x1F,0xFD,0xF2,0x00,0x01,0xC0,0x06,0x1F,0xFE,0xC4,0x00,0x00,0x00,0x00,0x0F,0xFF,0x08,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x07,0xFF,0x00,0x00,0x00,0x00,0x00,0x03,0xFE,0x00,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,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,0x00,0x00,0x00 }; 

Array generated by LCD Assistant:

PROGMEM const unsigned char lcdassistant[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x04, 0x08, 0x18, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x08, 0x0C, 0x06, 0x3E, 0xC0, 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, 0xC0, 0x30, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x70, 0xF8, 0xFC, 0xFC, 0x78, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3E, 0xFE, 0xFC, 0xBD, 0xF2, 0xC4, 0x08, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x61, 0x80, 0x00, 0x00, 0x00, 0x00, 0x60, 0xF0, 0xF9, 0xFD, 0xFB, 0xFA, 0x1B, 0xED, 0xDC, 0xDC, 0xBC, 0xB8, 0x70, 0x70, 0x70, 0x7C, 0x7D, 0x7D, 0xFD, 0xFE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x41, 0x23, 0x16, 0x0C, 0x08, 0x00, 0x01, 0x03, 0x07, 0x0F, 0x0F, 0x1E, 0x1D, 0x3B, 0x7B, 0xF7, 0x37, 0x37, 0x3B, 0x3B, 0x3B, 0xBD, 0x9E, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x23, 0x43, 0x83, 0x82, 0x84, 0x88, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1E, 0x3F, 0x7E, 0x9E, 0x0C, 0x08, 0x10, 0x21, 0x42, 0x42, 0x21, 0x21, 0x10, 0x10, 0x09, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x31, 0x40, 0x80, 0x01, 0x00, 0x10, 0xF0, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0xC1, 0x82, 0x04, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
1 Like

Hmm, I see… it seems the Arduboy (or LCD Assistant) discard the padding and directly append each new line’s data in the middle of the last byte of previous line’s data if this byte was incomplete (i.e. if the width of the image is not a multiple of 8…)
As a result the LCD Assistant array produces an asynched picture in Paintuino, with all lines starting a little too early at the end of the line before.
This method of ignoring padding saves a few bits of memory but it is definitely tricky to handle :sweat:

Before I try fixing this (it may be hard to implement), I want to be sure of the method. Does anybody know where the encoding of Arduino bitmaps is specified ? I didn’t find anything in the reference.

Nicolas

I haven’t found a reference for this padding either. I guess the simplest algorithm would be first to make an array of bits (unsigned int 0 and 1) and then chunk this array into bytes (vertically for the Arduboy).

Also, I think that the bitmap format is vertical because it’s faster to write it to the buffer this way as sBuffer is vertically formatted (drawBitmap() vs drawSlowXYBitmap).

It may be possible to format sBuffer horizontally and then use an horizontal addressing mode with the SSD1306 (p. 35 of the datasheet). Maybe @Dreamer3 could tell us if there are any drawbacks in doing that?

Edit: Oops, forget my idea, there are 8 pages vertically (8x8 = 64 pixels vertically) even when using horizontal addressing mode…

This tool looks really cool, but when I select the arduboy option and implant the code, the image comes out extremely jumbled. I can’t make any sense of it. The image is 96x48 so it shouldn’t be a multiple of 8 issue.

I haven’t found a great way to take pictures of the screen yet to demonstrate.

I don’t have any Arduboy devkit and I don’t know any emulator so unfortunately for the moment I’m stuck on the Arduboy side… Gamebuino option works well on the other hand, I used the programs for several apps successfully.
Only thing left is wait for my Arduboy to see what’s happening. I didn’t follow the news on the Arduboy scene for a while, are they still planned to be shipped this month ?

They have about 2 weeks delay due a big holiday in China.

We get details next week when Kevin is there.