Is there a way to draw my image using the output from the File to C Array Converter?
#include <hardware/i2c.h>
#define DISPLAY_SCL 11
#define DISPLAY_SDA 10
#define DISPLAY_I2C i2c1
#define DISPLAY_ADD 0x3C
#define DISPLAY_HZ 800000
#include "Driver/ssd1306.h"
#define IMG_HEIGHT 64
#define IMG_WIDTH 64
// array size is 512
uint8_t *IMG = (uint8_t[]){
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0111110, 0b0000000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000001, 0b1000001, 0b1100000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000110, 0b0111110, 0b0011000, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0011001, 0b1111111, 0b1100100, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b1100111, 0b1111111, 0b1111010, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000001, 0b0011111, 0b1111111, 0b1111010, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000010, 0b1111111, 0b1111111, 0b1111101, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0001101, 0b1111111, 0b1111111, 0b1111101, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0010011, 0b1101111, 0b1111111, 0b1111101, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0101111, 0b1110111, 0b1111111, 0b1111101, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b1011111, 0b1110111, 0b1111111, 0b1111101, 0b1000000,
0b0000000, 0b0000000, 0b0110001, 0b0111111, 0b1111011, 0b1111111, 0b1111101, 0b1000000,
0b0000000, 0b0000000, 0b0111000, 0b1111111, 0b1111011, 0b0001110, 0b1111101, 0b1000000,
0b0000000, 0b0000000, 0b0011101, 0b0111111, 0b1111011, 0b1111110, 0b1111101, 0b1000000,
0b0000000, 0b0000000, 0b0001110, 0b1001111, 0b1111011, 0b1111110, 0b1111011, 0b1000000,
0b0000000, 0b0000000, 0b0000111, 0b1110011, 0b1111111, 0b1111101, 0b1111011, 0b1000000,
0b0000000, 0b0000000, 0b0100011, 0b0111100, 0b1111111, 0b1111101, 0b0111011, 0b1000000,
0b0000000, 0b0000000, 0b1010001, 0b1011111, 0b0111111, 0b1111011, 0b0111010, 0b1000000,
0b0000000, 0b0000000, 0b0110000, 0b1100111, 0b1001111, 0b1111011, 0b1010101, 0b1000000,
0b0000000, 0b0000000, 0b0111000, 0b1110001, 0b1110011, 0b1111111, 0b1010111, 0b1000000,
0b0000000, 0b0000001, 0b1111000, 0b0111010, 0b1111100, 0b1111111, 0b1001101, 0b1000000,
0b0000000, 0b0000010, 0b1111100, 0b0011101, 0b0011111, 0b1111111, 0b1101111, 0b1000000,
0b0000000, 0b0000101, 0b1111101, 0b0001110, 0b1100111, 0b0111111, 0b1010111, 0b0000000,
0b0000000, 0b0001011, 0b1111110, 0b1010111, 0b1110001, 0b0011111, 0b1011111, 0b0000000,
0b0000000, 0b0001011, 0b1111110, 0b0101011, 0b0100000, 0b0111111, 0b0111101, 0b0000000,
0b0000000, 0b0010111, 0b1111011, 0b1001101, 0b1000001, 0b1011110, 0b0111111, 0b0000000,
0b0000000, 0b0010111, 0b1110111, 0b0100110, 0b1100010, 0b0011111, 0b1111111, 0b0000000,
0b0000000, 0b0101111, 0b1110111, 0b0010111, 0b1110101, 0b0010001, 0b1111111, 0b0000000,
0b0000000, 0b0101111, 0b1101111, 0b0111010, 0b0111010, 0b0111010, 0b1111111, 0b0000000,
0b0000000, 0b1011111, 0b1111111, 0b1011010, 0b0011100, 0b1111001, 0b1111110, 0b0000000,
0b0000000, 0b1011011, 0b1011111, 0b1011100, 0b0001100, 0b0110011, 0b1111110, 0b0000000,
0b0000000, 0b0111100, 0b0111111, 0b1101100, 0b0000001, 0b1110111, 0b1111100, 0b0000000,
0b0000000, 0b0111111, 0b0111111, 0b1101100, 0b0000010, 0b1110111, 0b1111100, 0b0000000,
0b0000001, 0b1111111, 0b1000000, 0b1110000, 0b0000001, 0b0101111, 0b1111000, 0b0000000,
0b0000001, 0b1111111, 0b1111111, 0b1110000, 0b0000111, 0b1011111, 0b1111000, 0b0000000,
0b0000001, 0b1111111, 0b1111111, 0b1110000, 0b0000110, 0b0111111, 0b1111000, 0b0000000,
0b0000001, 0b1111111, 0b1111111, 0b1110010, 0b0001011, 0b1011101, 0b1110000, 0b0000000,
0b0000010, 0b1111111, 0b1111111, 0b1110001, 0b0100110, 0b1111111, 0b1100100, 0b0000000,
0b0000010, 0b1111111, 0b1111111, 0b1110010, 0b0001001, 0b1110111, 0b1000100, 0b0000000,
0b0000010, 0b1111111, 0b1111111, 0b1010010, 0b1010111, 0b1111111, 0b0000100, 0b0000000,
0b0000010, 0b1111111, 0b1111111, 0b0110000, 0b1101101, 0b1011101, 0b0000100, 0b0000000,
0b0000010, 0b1111111, 0b0111111, 0b1110001, 0b1011010, 0b1111110, 0b0000100, 0b0000000,
0b0000010, 0b1111111, 0b1011110, 0b1110011, 0b0110101, 0b1010100, 0b0010100, 0b0000000,
0b0000010, 0b1111111, 0b1111100, 0b0111110, 0b1101011, 0b1111000, 0b0000100, 0b0000000,
0b0000010, 0b1111111, 0b1110011, 0b1111001, 0b1000101, 0b1010000, 0b0111100, 0b0000000,
0b0000001, 0b1111111, 0b1001111, 0b1100110, 0b0101010, 0b1100000, 0b0000010, 0b0000000,
0b0000001, 0b1111110, 0b0111111, 0b0011000, 0b0010101, 0b0000000, 0b1000010, 0b0000000,
0b0000000, 0b0011111, 0b1111110, 0b1101010, 0b0101110, 0b0000000, 0b0000110, 0b0000000,
0b0000000, 0b1100001, 0b1110001, 0b0000000, 0b0010000, 0b0000001, 0b1111100, 0b0000000,
0b0000000, 0b0111110, 0b0001110, 0b0001000, 0b1100000, 0b0000111, 0b1111100, 0b0000000,
0b0000000, 0b0001111, 0b1110000, 0b0001111, 0b0000000, 0b0000000, 0b0000110, 0b0000000,
0b0000000, 0b0000000, 0b1111111, 0b1111000, 0b0000000, 0b0000010, 0b1000010, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b0000000, 0b1111111, 0b1111110, 0b0000000,
0b0000000, 0b0000000, 0b0000000, 0b0001111, 0b1111111, 0b1111111, 0b1111110, 0b0000000
};
int main()
{
ssd1306_t display;
i2c_init(DISPLAY_I2C, DISPLAY_HZ);
gpio_set_function(DISPLAY_SCL, GPIO_FUNC_I2C);
gpio_set_function(DISPLAY_SDA, GPIO_FUNC_I2C);
gpio_pull_up(DISPLAY_SCL);
gpio_pull_up(DISPLAY_SDA);
if(!ssd1306_init(&display, 128, 128, DISPLAY_ADD, DISPLAY_I2C))
return 1;
ssd1306_poweron(&display);
ssd1306_clear(&display);
while (true)
{
ssd1306_clear(&display);
ssd1306_bmp_show_image(&display, IMG, 512);
ssd1306_show(&display);
}
ssd1306_poweroff(&display);
return 0;
}