Waveshare 7.5" ePaper (B/W/R) and GxEPD porting


#1

I saw this awesome video E-Paper + ESP8266 Tutorial - Easy Text & Images and got pursued to buy two 7.5" displays (black/white/red) - thought it would be easy to do on the particle photon (crawling down the rabbit hole).

I then came across this post E-ink display doesnt work where a lot of good people did some fantastic work ( especially @ScruffR - wow!)

My experience with Photon little (did manage to make an LCD display some stats from my database - success! :man_cartwheeling:) and porting other libs into it is zero.

I got the e-Paper HAT module and connected it as follows

BUSY -> D2
RST -> D4
DC -> D3
CS -> D6
CLK -> D5
DIN -> D7
GND -> GND
3.3V -> 3.3V

(This is like what is being suggested in the README of GxEPD for ESP8266 NodeMCU except that CS is suggested to connect to D8 - which do not exist on a Particle Photon)

I did my best to create all the files needed. Tried to compile and fixed what I could.

  • Created missing files
  • Fixed nested paths to root level
  • Changed some transfer16(x) to just transfer(x) - commented with // PORT CODE

But now I have hit a wall :man_facepalming:

All of my code is to be found here:

https://go.particle.io/shared_apps/5c02f971e7a08787830003cb

ANY HELP WILL BE HIGHLY APPRECIATED!!!

BTW: Perhaps I should mention that the final goal is to make it display some images (citations and funny memes etc.) that I’ll upload to the web somewhere and do some processing so the photon can easily grab one of them.


E-ink Display doesnt Work
#2

A very quick reply, suggest you look at GxEPD2 library and use the Adafruit_GFX_RK library (which includes lots of fonts). You do not need to include SPI since this is already included with Particle is you #include “Particle.h”. You will need to comment out a lot of the boards that you aren’t using, you also need WaveTable.h. Following is the top of the .ino file for a 3 colour 2.13" GoodDisplay.

> #include "Particle.h"
> #include "GxEPD2_3c.h"
> #include "FreeMonoBold9pt7b.h"
> #include "FreeMonoBold18pt7b.h"
> 
> #define MAX_DISPAY_BUFFER_SIZE 15000ul // ~15k is a good compromise
> #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPAY_BUFFER_SIZE / (EPD::WIDTH / 8))
> #define MAX_HEIGHT_3C(EPD) (EPD::HEIGHT <= (MAX_DISPAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8))
> GxEPD2_3C<GxEPD2_213c, MAX_HEIGHT_3C(GxEPD2_213c)> display(GxEPD2_213c(/*CS=*/ A2, /*DC=*/ D2, /*RST=*/ D1, /*BUSY=*/ D0));

#3

Wow! That was a quick reply.

I’m quite a newbie - would you mind sharing a working project so I can see the code and make a fork for 7.5inch?

BTW: I don’t really need a lot of fonts. Plan to print images that will contain the text in the image. Just wanted to start with a “hello world” print on the screen.


#4

There are waveshare libraries which can easily be modified already in the library. I’d take a look at them


#5

@AlbertZeroK Thank you very much!

I "just" need to be able to figure out how to print a b/w/r image onto the display.

Don’t mind if it’s the official waveshare lib or GxEPD(2) - whatever will work.


#6

The GxEPD2 has been generously ported by @ZinggJM - thank you so much!

(Now I need to figure out how to print my own images and not the logos in the lib)