Formatting OLED Graphics

It was not immediately obvious to me how format graphic for the Wifi 32 kit OLED ESP32 module, so here is the step by step process that I found to work.

  • Find your graphic, in one of the common formats – e.g Jpeg, but keep in mind it will converted to a low res black and white image
  • Using Windows paint convert to a bit size that will fit on the display (remembering that the max size is 128 x 64
  • Convert it to the XBM format
    1. visit Online Utility site http://www.online-utility.org/image_converter.jsp
    2. follow instructions to convert and save file to XMB format
    3. Edit the file using notepad (or similar text editor), firstly change the title to something sensible (yellow highlight), then change the main array from ‘static char’ (red highlight) to ‘const unsigned char’ – see example below. Note: – The PROGMEM directive puts the array data into the program area rather than using variable space
    4. Change the file extension to ‘.h’ and save it to the same sub-director as the .ino source file