E-ink Display doesnt Work


#21

Hi @ScruffR I’m new to all this and I need a little help wiring a wave share Epaper 1.54 inch with my Particle Photon.

This is the link of the Epaper I am trying to connect:
https://www.waveshare.com/wiki/1.54inch_e-Paper_Module

I have this available pins on my Epaper side and I made this connections according to your diagram.
VCC -> Not mentioned I assumed 3V3
GND -> Not mentioned I assumed GND
DIN -> A5
CLK -> A3
CS -> A2
DC -> A1
RST -> A0
BUSY -> D7

I then flashed this sample you provided: https://build.particle.io/build/5a7e2f45bac3fca9dc000c94
I don’t see any changes or anything appearing on my Epaper display. Are my Pin assumption for VCC and GND correct? Am I missing something?
Thank you!!!


#22

That sample link doesn’t work for public use - your projects are private.
To let someone else have a look you need to share a public link to a snapshot
image


#23

Hey @ScruffR thank you so much! I really appreciate your help. I was able to create a sharable link https://go.particle.io/shared_apps/5a7e462fbac3fca9dc000dae

I haven’t done much to the code it is just a copy of this example https://build.particle.io/libs/WaveshareEPaper29b/0.0.1/tab/example/EPaper29b.ino

I’m wondering if this library works on the black only display. It mentions red and black in the code. And the display I’m using is black only.
This is the link of the display https://www.waveshare.com/wiki/1.54inch_e-Paper_Module1

I’m just trying to print a Hello World. The code gets flashed correctly to my Particle but nothing changes on the display.

Thank you :slight_smile:


#24

AFAICT, the library layout of WaveShare is not targeted for flexibility/interoperability.
I think you can use the 29b (b/r/w) library for the 29 (b/w) by just using the single frame functions, but I’m quite convinced it won’t play well with the 1.54" display.

But as I found, as clumsy the stock libraries for their displays are, they should be able to build for Particle without alteration. I just couldn’t resist rewriting the most unsettling code portions.


#25

@ScruffR Thank you so much! I’m gonna try with that library. 29b… How do I add it to my project on the particle cloud? Is already there or I need to download it from WaveShare and include it manually?


#26

29b is for the 2.9" display. You said yours is 1.54" and I don’t think that the 2.9" lib will give you any recognisable image.
As I haven’t ported the 1.54 library, you will need to download it from WaveShare and copy-paste it into your project.


#27

Hey @ScruffR thank you once again. I was able to download the library from:


and add it to an empty project https://go.particle.io/shared_apps/5a7fca526204ca298d0010a5
However, when trying to run it I’m getting all kind of errors. Am I doing anything wrong?
@gedeondt I saw you were also trying to use a 1.54" Waveshare display, were you able to do it?


#28

This line was the first to throw an error

class GxGDEP015OC1 : public GxEPD
GxGDEP015OC1.h:62:1: expected class-name before '{' token

Which indicates that you are missing the class definition for GxEPD. Hence this commented code line

//#include "../GxEPD.h"

Since this header is not included chances are that every error that follows may go away, once you also add this definition and implementation to the project.


#29

@ScruffR Thank you so much! I’ve just managed to import the library I need which is this:

Into my project which is this: https://go.particle.io/shared_apps/5a80ec3e5f7e89dfb7000bf3

I think I’m almost there, however I’m getting two new errors and I cannot find where they are coming from.

Adafruit_GFX.h:7:20: expected unqualified-id before ‘{’ token
error
GxGDEP015OC1.h:101:5: expected unqualified-id before ‘{’ token

If you have any suggestion that would be amazing.


#30

The problem is that both libraries bring in conflicting implementations/definitions of a function swap().

One way to get around this is to add this after all #include and #define lines of GxGDEP015OC1.h

#ifdef swap
#undef swap
#endif

#31

Hey @ScruffR

Code verified! Great work.

Thanks a lot! Now I’m going to try using it and I’ll let you know the Outcome.

:slight_smile:


#32

@ScruffR,

I just got a Waveshare 2.9" Module B inspired in part by your video. Unlike you, I could not get the code provided by Waveshare to compile and was wondering if you might share a link to your code.

Thanks,

Chip


#33

@chipmc, you can use my tweaked “port” of their library
https://build.particle.io/libs/WaveshareEPaper29b/0.0.1


#34

@ScruffR,

I actually started with that library but, it does not compile either. The error is:

wavesharedemo.ino:67:9: 'class Paint' has no member named 'SetWidth'

wavesharedemo.ino:68:9: 'class Paint' has no member named 'SetHeight'

Which comes from these lines in the code from EPaper29b.ino

 paint.SetWidth(64);
 paint.SetHeight(64);

What am I doing wrong?

Chip


#35

I’ll have to have another look. For some reason these functions are commented out (who knows why I did that back then :blush: )
But you can try the EPaper29bRotate demo. This doesn’t seem to use these functions.


#36

@ScruffR,

No joy. It will compile but nothing on the display.

Running Photon - 0.7.0rc-7

As a check, am I wiring this right?

Display - Photon
3.3V - 3.3V
GND - GND
RESET - A0
DC - A1
CS - A2 (SS)
CLK - A3 (CLK)
DI - A4 (MISO)
BUSY - D7

Also, there is a line in the main loop: if (!digitalRead(BTN)), that makes me think there is another connection I need to make. I did not see a reference to BTN anywhere else in the code.

Thanks for your help

Chip


#37

BTN is the GPIO designation for the SETUP/MODE button on your device.

I’ll take apart my current ePaper project and figure what’s wrong.
Since I originally hadn’t published the library but only used it privately it may well be that I over-tweaked the lib to fit my own needs better, not double-checking the samples before later on publishing it on Web IDE :flushed:

I’ll get back to you.


#38

@ScruffR,

Thank you!

Chip


#39

I’ve just now tried out the rotation demo and it worked for me, but since I’ve got my display soldered to my project I couldn’t test your connections.

This is how I have connected the display and set it up in code

//CLK              = A3; // SPI CLK
//DI               = A5; // SPI MOSI (master out slave in)
const int pCS      = A2;
const int pRESET   = D6;
const int pDC      = D5;
const int pBUSY    = D4;

Epd   epd(SPI, pCS, pDC, pRESET, pBUSY);

I think the main point with your setup is that you are using A4 (MISO = master in slave out) which is the wrong communication direction. The µC is the master the display the slave.

BTW, I now remember why I commented these two functions.
The reason was that I intended to rewrite these functions to cater for screen rotations, but due to some unexpected memory layout for the data, it turned out to be a bigger task than I first anticipated, so I just moved on to get my project finished (which doesn’t need it) and then totally forgot about it :flushed:


#40

@ScruffR,

As Homer would say - Doh! You are right, I had the wrong SPI pin. The display is now responding so I can start to play with it. Thank you!

Chip