I have an WEMONS S2 mini and a Waveshare 2.13 V4 Screen. Everything works fine, except I dont get this one function to work: drawBitmap.
I tried different librarys many combinations of the code, every time there is some different error message.
Currently I'm trying to use the GxEPD2 library which is very good for e-paper displays usually.
My code looks like this:
#include <GxEPD2_BW.h>
//#include <GxEPD2_3C.h>
//#include <GxEPD2_7C.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include <U8g2_for_Adafruit_GFX.h>
// select the display class and display driver class in the following file (new style):
//#include "GxEPD2_display_selection_new_style.h"
// alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h to here
// e.g. for Wemos D1 mini:
GxEPD2_BW<GxEPD2_213_B74, GxEPD2_213_B74::HEIGHT> display(GxEPD2_213_B74(/*CS=5*/ 12, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM0213B74 122x250, SSD1680
//GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67
U8G2_FOR_ADAFRUIT_GFX u8g2Fonts;
int WiFi_Logo_width = 60;
int WiFi_Logo_height = 36;
const char WiFi_Logo_bits[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF,
0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0x03, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0x07, 0xC0, 0x83, 0x01, 0x80, 0xFF, 0xFF, 0xFF,
0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00,
0xC0, 0xFF, 0xFF, 0x7C, 0x00, 0x60, 0x0C, 0x00, 0xC0, 0x31, 0x46, 0x7C,
0xFC, 0x77, 0x08, 0x00, 0xE0, 0x23, 0xC6, 0x3C, 0xFC, 0x67, 0x18, 0x00,
0xE0, 0x23, 0xE4, 0x3F, 0x1C, 0x00, 0x18, 0x00, 0xE0, 0x23, 0x60, 0x3C,
0x1C, 0x70, 0x18, 0x00, 0xE0, 0x03, 0x60, 0x3C, 0x1C, 0x70, 0x18, 0x00,
0xE0, 0x07, 0x60, 0x3C, 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C,
0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00,
0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x8F, 0x71, 0x3C,
0x1C, 0x70, 0x18, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x08, 0x00,
0xC0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x0C, 0x00, 0x80, 0xFF, 0xFF, 0x1F,
0x00, 0x00, 0x06, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x07, 0x00,
0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0xFF, 0xFF,
0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00,
0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF,
0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
void setup()
{
Serial.begin(115200);
//display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02
display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
u8g2Fonts.begin(display); // connect u8g2 procedures to Adafruit GFX
}
void loop() {
uint16_t bg = GxEPD_WHITE;
uint16_t fg = GxEPD_BLACK;
display.setRotation(1);
u8g2Fonts.setFontMode(1); // use u8g2 transparent mode (this is default)
u8g2Fonts.setFontDirection(0); // left to right (this is default)
u8g2Fonts.setForegroundColor(fg); // apply Adafruit GFX color
u8g2Fonts.setBackgroundColor(bg); // apply Adafruit GFX color
display.firstPage();
do
{
display.fillScreen(bg);
display.drawBitmap(0, 0, WiFi_Logo_bits, WiFi_Logo_width, WiFi_Logo_height, GxEPD_BLACK);
u8g2Fonts.setCursor(5, 10);
u8g2Fonts.setFont(u8g2_font_6x10_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2Fonts.print("Mo 12.12.23 12:45");
u8g2Fonts.setCursor(150, 10);
u8g2Fonts.print("20° 45%");
u8g2Fonts.setCursor(218, 10);
u8g2Fonts.print("85%");
u8g2Fonts.setCursor(240, 11);
u8g2Fonts.setFont(u8g2_font_twelvedings_t_all); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2Fonts.print(char(118));
display.drawLine(0, 15, 250, 15, GxEPD_BLACK);
u8g2Fonts.setCursor(5, 60);
u8g2Fonts.setFont(u8g2_font_6x12_me); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2Fonts.print("u8g2_font_6x12_me");
u8g2Fonts.setFont(u8g2_font_profont11_tr); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2Fonts.print("u8g2_font_profont11_tr");
u8g2Fonts.setCursor(15, 85);
u8g2Fonts.setFont(u8g2_font_6x13_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2Fonts.print("u8g2_font_6x13_tf");
}
while (display.nextPage());
//Serial.println("helloEpaper done");
delay (20000);
};
and I get the following error message:
C:\Users\lenov\Meine Ablage\Sonstiges\Arduino\5 Displays\Epaper_GxEPD2_S2mini\Epaper_GxEPD2_S2mini.ino: In function 'void loop()':
C:\Users\lenov\Meine Ablage\Sonstiges\Arduino\5 Displays\Epaper_GxEPD2_S2mini\Epaper_GxEPD2_S2mini.ino:78:23: error: no matching function for call to 'drawBitmap(int, int, const char [288], int&, int&, int)'
78 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from c:\Users\lenov\Documents\Arduino\libraries\GxEPD2\src/GxEPD2_BW.h:29,
from C:\Users\lenov\Meine Ablage\Sonstiges\Arduino\5 Displays\Epaper_GxEPD2_S2mini\Epaper_GxEPD2_S2mini.ino:1:
c:\Users\lenov\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:88:8: note: candidate: 'void Adafruit_GFX::drawBitmap(int16_t, int16_t, uint8_t*, int16_t, int16_t, uint16_t)' (near match)
88 | void drawBitmap(int16_t x, int16_t y, uint8_t bitmap, int16_t w, int16_t h,
| ^~~~~~~~~~
c:\Users\lenov\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:88:8: note: conversion of argument 3 would be ill-formed:
C:\Users\lenov\Meine Ablage\Sonstiges\Arduino\5 Displays\Epaper_GxEPD2_S2mini\Epaper_GxEPD2_S2mini.ino:78:30: error: invalid conversion from 'const char' to 'uint8_t*' {aka 'unsigned char*'} [-fpermissive]
78 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
| ^~~~~~~~~~~~~~
| |
| const char*
c:\Users\lenov\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:84:8: note: candidate: 'void Adafruit_GFX::drawBitmap(int16_t, int16_t, const uint8_t*, int16_t, int16_t, uint16_t)' (near match)
84 | void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
| ^~~~~~~~~~
c:\Users\lenov\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:84:8: note: conversion of argument 3 would be ill-formed:
C:\Users\lenov\Meine Ablage\Sonstiges\Arduino\5 Displays\Epaper_GxEPD2_S2mini\Epaper_GxEPD2_S2mini.ino:78:30: error: invalid conversion from 'const char*' to 'const uint8_t*' {aka 'const unsigned char*'} [-fpermissive]
78 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
| ^~~~~~~~~~~~~~
| |
| const char*exit status 1
Compilation error: no matching function for call to 'drawBitmap(int, int, const char [288], int&, int&, int)'
so it seems to be this line of my code:
display.drawBitmap(0, 0, WiFi_Logo_bits, WiFi_Logo_width, WiFi_Logo_height, GxEPD_BLACK);
and I dont get it. What do I have to change to make it work?