Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15265

Bitmap does not display correct

$
0
0

I am trying to display a logo on a ssd1306 based Oled-display.
But all I get is white display with some black pixels but no logo
I have treid GIMP and LCDassistant to create a hex-bitmap.
This is the code:

/*
  Bitmap.ino
  Show simple bitmap
*/
#include "U8glib.h"

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST);	// Fast I2C / TWI 

//------------------------------------------------------------------------------
// File generated by LCD Assistant
// http://en.radzio.dxp.pl/bitmap_converter/
//------------------------------------------------------------------------------

#define LOGOdef_width 78
#define LOGOdef_height 64
static unsigned char LOGOdef[] U8G_PROGMEM = {
   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0x3f, 0xff, 0xff,
   0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
   0xff, 0xff, 0x07, 0xf0, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   0x01, 0xe0, 0xff, 0x3f, 0xff, 0xff, 0x7f, 0x00, 0xfe, 0x7f, 0x00, 0x80,
   0xff, 0x3f, 0xff, 0xff, 0x3f, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0xff, 0x3f,
   0xff, 0xff, 0x3f, 0x01, 0xf8, 0x07, 0x00, 0x00, 0xfe, 0x3f, 0xff, 0xff,
   0x3f, 0x00, 0xf0, 0x01, 0x40, 0x00, 0xfc, 0x3f, 0xff, 0xff, 0x3f, 0x00,
   0xe0, 0x01, 0x10, 0x00, 0xfe, 0x3f, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0x03,
   0x00, 0x80, 0xff, 0x3f, 0xff, 0xff, 0x3f, 0x00, 0x80, 0x00, 0x00, 0xc0,
   0xff, 0x3f, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x8c, 0x00, 0xf0, 0xff, 0x3f,
   0xff, 0xff, 0x3f, 0x00, 0x00, 0x3e, 0x00, 0xfc, 0xff, 0x3f, 0xff, 0xff,
   0x3f, 0x00, 0x00, 0x3e, 0x00, 0xfe, 0xff, 0x3f, 0xff, 0xff, 0x3f, 0x00,
   0x00, 0x7e, 0x80, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0,
   0xc0, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x60, 0xf0, 0xff,
   0xff, 0x3f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f,
   0xff, 0xff, 0xdf, 0x01, 0x00, 0x80, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
   0x87, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x01, 0x24,
   0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0xff, 0x7f, 0x00, 0x0e, 0x00, 0x00,
   0xfc, 0xff, 0xff, 0x3f, 0xff, 0x1f, 0x00, 0x1e, 0x00, 0x00, 0xf8, 0xff,
   0xff, 0x3f, 0xff, 0x0f, 0x00, 0xfe, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f,
   0xff, 0x01, 0x00, 0xf8, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0x7f, 0x00,
   0x00, 0x78, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x1f, 0x00, 0x00, 0x30,
   0x00, 0x00, 0xd4, 0xff, 0xff, 0x3f, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00,
   0x90, 0xff, 0xff, 0x3f, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0xc0, 0xff,
   0xff, 0x3f, 0x00, 0xc0, 0x00, 0xe0, 0x03, 0x00, 0xc8, 0x0f, 0xfe, 0x3f,
   0x01, 0x00, 0x00, 0xf0, 0x07, 0x00, 0xc0, 0x01, 0xf8, 0x3f, 0x01, 0x04,
   0x00, 0xfc, 0x0f, 0x88, 0x60, 0x00, 0xf0, 0x3f, 0x03, 0x00, 0x00, 0xff,
   0x1f, 0x00, 0x00, 0xc0, 0xf7, 0x3f, 0x83, 0x00, 0x80, 0xff, 0x3f, 0x04,
   0x00, 0xe0, 0xf7, 0x3f, 0x07, 0x00, 0xe0, 0xff, 0x7f, 0x20, 0x00, 0xcc,
   0xf7, 0x3f, 0x0f, 0x00, 0xf8, 0xff, 0x7f, 0x04, 0x00, 0xcf, 0xf3, 0x3f,
   0x0f, 0x00, 0xfe, 0xff, 0xff, 0x04, 0x80, 0xcf, 0xfb, 0x3f, 0x1f, 0x00,
   0xff, 0xff, 0xff, 0x43, 0x80, 0xcf, 0xf9, 0x3f, 0x1f, 0xc0, 0xff, 0xff,
   0xff, 0x7f, 0x20, 0xcf, 0xfd, 0x3f, 0x3f, 0xf0, 0xff, 0xff, 0xff, 0x3f,
   0x80, 0xcf, 0xfc, 0x3f, 0x7f, 0xf8, 0xff, 0xff, 0xff, 0x3f, 0xf8, 0x4f,
   0xfe, 0x3f, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0x4f, 0xff, 0x3f,
   0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0x0f, 0xff, 0x3f, 0xff, 0xff,
   0xff, 0xff, 0xff, 0x0f, 0xfc, 0x8f, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
   0xff, 0x0f, 0xe0, 0xc3, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
   0x07, 0xc2, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x7f, 0x80,
   0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0x88, 0xff, 0x3f,
   0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x3f, 0x9e, 0xe7, 0x3e, 0xff, 0xff,
   0xff, 0xff, 0xff, 0xcf, 0x8f, 0xff, 0xe7, 0x0c, 0xff, 0xff, 0xff, 0xff,
   0xff, 0x1f, 0xe0, 0xff, 0xe7, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
   0xfa, 0xff, 0x63, 0x0c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   0x71, 0x0e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x78, 0x06,
   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x3c, 0x27, 0xff, 0xff,
   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x27, 0xff, 0xff, 0xff, 0xff,
   0xff, 0xff, 0xff, 0xff, 0x87, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   0xff, 0xff, 0xe1, 0x31, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
   0xf0, 0x38, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x7c, 0x3c,
   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x3e, 0xff, 0xff,
   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x3f, 0xff, 0xff, 0xff, 0xff,
   0xff, 0xff, 0xff, 0x0f, 0xc0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   0xff, 0x0f, 0xf0, 0x3f };


void draw(void) {
  // graphic commands to redraw the complete screen should be placed here  
  u8g.drawBitmapP( 0, 0, LOGOdef_width, LOGOdef_height, LOGOdef);
}

void setup(void) {
}

void loop(void) {
  // picture loop
  u8g.firstPage();  
  do {
    draw();
  } while( u8g.nextPage() );
  
  // rebuild the picture after some delay
  delay(1000);
}

As this is my first project using this display so what is wrong here??

7 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 15265

Trending Articles