Suppose image2lcd outputs the following bytes for a 16×16 icon (two pages of 8 rows): Page 0 columns 0..15: 0x3C,0x42,0xA9,0x85,0x85,0xA9,0x91,0x42,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00 Page 1 columns 0..15: 0x00,0x00,0x18,0x3C,0x42,0x24,0x24,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00
Register-style snippet for SSD1306 I2C:
/* Set page/col bounds omitted for brevity */
0x40, 0x3C,0x40, 0x42,0x40, 0xA9,... (16 bytes page0)
0x40, 0x00,0x40, 0x00,0x40, 0x18,... (16 bytes page1)
Generating the code is only half the battle. You must integrate it into your project. image2lcd register code
While Image2LCD is excellent for register code, be aware of modern alternatives:
However, Image2LCD remains superior for legacy controllers and ultra-low-resource systems (8-bit MCUs with 2KB RAM). Suppose image2lcd outputs the following bytes for a
For an ILI9341 (240x320, SPI, 16-bit RGB565), the tool might produce:
// ILI9341 Initialization Commands
// Format: command, data_length, data_bytes...
const uint8_t ili9341_init_cmds[] =
0x01, 0x00, // Software Reset
0x11, 0x00, 0x80, // Sleep Out + delay 80ms
0x36, 0x01, 0x48, // Memory Access Control (MX/MY/BGR)
0x3A, 0x01, 0x55, // Pixel Format Set = 16-bit RGB565
0x2A, 0x04, 0x00, 0x00, 0x01, 0x3F, // Column Address Set
0x2B, 0x04, 0x00, 0x00, 0x01, 0x3F, // Page Address Set
0x29, 0x00, // Display ON
0x2C, 0x00 // Memory Write (ready for pixel data)
;
Sometimes the tool adds delay fields, e.g.: Generating the code is only half the battle
0x11, 0, 120, // Exit sleep, 120ms delay
void SSD1306_SendRegisterCode(const uint8_t *code, uint32_t len)
for (uint32_t i = 0; i < len; i++)
if (code[i] == 0x00)
i++;
ssd1306_command(code[i]); // Send command
else if (code[i] == 0x40)
i++;
while (i < len && code[i] != 0x00 && code[i] != 0x40)
ssd1306_data(code[i++]);
i--; // Adjust loop
Image2LCD generates a generic initialization. If your text appears backward or upside down, look for the Memory Access Control register in the generated code (often 0x36 for ILI9341/ST7789).