Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<Arduino.h>
- #include<U8g2lib.h>
- #ifdef U8X8_HAVE_HW_SPI
- #include<SPI.h>
- #endif
- #ifdef U8X8_HAVE_HW_I2C
- #include<Wire.h>
- #endif
- U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED
- // Copy the contents of your .xbm file below
- #define michau_width 45
- #define michau_height 32
- static const unsigned char michau_bits[] PROGMEM = {
- 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a, 0xff, 0xff, 0x01, 0xff, 0xff, 0x1f,
- 0xaa, 0x2a, 0x00, 0xa8, 0xaa, 0x0a, 0xff, 0x1f, 0x00, 0xf8, 0xff, 0x1f,
- 0xaa, 0x0a, 0x00, 0xa0, 0xaa, 0x0a, 0xff, 0x07, 0x00, 0xe0, 0xff, 0x1f,
- 0xaa, 0x02, 0x18, 0xa0, 0xaa, 0x0a, 0xff, 0xc3, 0x7f, 0xc0, 0xff, 0x1f,
- 0xaa, 0xe2, 0xff, 0x83, 0xaa, 0x0a, 0xff, 0xf3, 0xff, 0x87, 0xff, 0x1f,
- 0xaa, 0xf2, 0xff, 0x8f, 0xaa, 0x0a, 0x55, 0xf1, 0xff, 0x0f, 0x55, 0x15,
- 0xaa, 0xf0, 0xff, 0x8f, 0xaa, 0x0a, 0x55, 0xfe, 0xff, 0x0f, 0x55, 0x15,
- 0xaa, 0xfe, 0xff, 0x8f, 0xaa, 0x0a, 0x55, 0x06, 0xfc, 0x0f, 0x55, 0x15,
- 0xaa, 0x06, 0x00, 0x20, 0xaa, 0x0a, 0x55, 0x06, 0x08, 0x60, 0x55, 0x15,
- 0xaa, 0x06, 0x1c, 0x30, 0xaa, 0x0a, 0x55, 0x0e, 0x1c, 0x30, 0x55, 0x15,
- 0xaa, 0xfc, 0x7f, 0xb8, 0xaa, 0x0a, 0x55, 0xf9, 0xf7, 0x1f, 0x55, 0x15,
- 0xaa, 0xfa, 0xe3, 0x87, 0xaa, 0x0a, 0x55, 0xf9, 0xff, 0x57, 0x55, 0x15,
- 0xaa, 0xf2, 0x80, 0xa3, 0xaa, 0x0a, 0x55, 0xf5, 0xc1, 0x53, 0x55, 0x15,
- 0xaa, 0xe2, 0xff, 0xa9, 0xaa, 0x0a, 0x55, 0xc9, 0xff, 0x55, 0x55, 0x15,
- 0xaa, 0x98, 0x7f, 0xa8, 0xaa, 0x0a, 0x55, 0x3c, 0x3f, 0x54, 0x55, 0x15,
- 0x02, 0x7c, 0x80, 0xa8, 0xaa, 0x0a, 0x00, 0xfc, 0xff, 0x50, 0x55, 0x15 };
- void draw(void) {
- // graphic commands to redraw the complete screen should be placed here
- u8g2.drawXBMP( 0, 0, michau_width, michau_height, michau_bits);
- }
- void setup(void) {
- u8g2.begin();
- }
- void loop(void) {
- // picture loop
- u8g2.firstPage();
- do {
- draw();
- } while( u8g2.nextPage() );
- // rebuild the picture after some delay
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment