I've been working on a weather station, using the ESP32, along with a MH-ET live 2.9" 296x128 e-paper display. I'm using openweathermap to get my data and I've successfully managed to display that on my screen, using the GxEPD2 library, together with U8g2_for_Adafruit_GFX so I can use different kinds of fonts.
Support for this display was added to the GxEPD2 library only recently. I've used the example sketch named "GxEPD2_MinimalExample" and set it up for the display named "GDEW029M06" for the ESP32.
My display is initialized with the following code:
void setup()
{
display.init();
//uint16_t bg = GxEPD_WHITE; // These are declared outside of the setup
//uint16_t fg = GxEPD_BLACK;
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
u8g2Fonts.begin(display);
display.setRotation(3);
u8g2Fonts.setFont(u8g2_font_9x18_mr);
}
After gathering my data, I can then use
u8g2Fonts.print("Type your text here");
to display that code on the e-paper screen.
Now I'm trying to use some icons to show the different weather types. I would like to do this, because it saves me from having to individually format every possible weather scenario to fit on the screen and because it looks much better.
I've included the following file (weathericons.h), which has the weather icons I need:
I've done the inclusion right, because the IDE does recognise the file, but I've not been able to display any of these icons on the e-paper display yet. That's where my question comes in.
How can I display the custom icons, stored in the weathericons.h file, on my e-paper display?
I think the file your link points to contains copyrighted material. But I don't see any copyright notice.
Did you remove the copyright notice?
You can do that for your copy, but re-publish is then not allowed.
Unless you don't clarify the copyright situation, I can't help you.
direct drawing has an artifact on the right, as width is not a multiple of 8.
On the rounded corners you can see that the bitorder is wrong for Adafruit_GFX and GxEPD2.
The other Icons have 6 header bytes that could be skipped.
But depth is 2 which is not supported by Adafruit_GFX and GxEPD2 for in-memory bitmaps.
You could analyze the ThingPulse code, to find out how to draw these icons. I don't have time for this.
Thank you kindly for helping me get my code to work. The image now shows up, but as you mentioned, the bitorder is wrong. I'll check how I can fix that.