Go Down

Topic: Waveshare e-paper displays with SPI (Read 270135 times) previous topic - next topic

Thomasx

I got a new display from the store, and it worked better.

heckiyt

#1756
Mar 14, 2020, 03:23 pm Last Edit: Mar 14, 2020, 03:25 pm by heckiyt
Hey,

I'm trying to build a thermometer with an Arduino Nano Every and a 1.54 inch (200x200) e-paper display.
Now I don't understand how to mess with GxEPD2. Now I want to ask you how I could do it.
I have this code for GxEPD1 but it isn't working for my Nano, only for my UNO R3:
Code: [Select]
#include <GxEPD2.h>
#include <GxGDEW0154Z04/GxGDEW0154Z04.h>  // 1.54" b/w/r 200x200
#include <Adafruit_GFX.h>
//#include <Fonts/FreeMonoBold9pt7b.h>
#include <Fonts/SansSerif_plain_60.h>
#include <Fonts/Meteocons_Regular_60.h>
//#include <Wire.h>
//#include <Adafruit_Sensor.h>
//#include <Adafruit_BME280.h>

GxEPD_Class display(SPI, SS, 9, 8);
//Adafruit_BME280 bme;

void setup(void)
{
  display.init();
  //if (!bme.begin(0x76)) {
    display.drawPaged(error);
  //  while (1);
  //} else {
  //  display.drawPaged(icons);
  //}
}

void loop()
{

}

void temprature(float temp, float hum) {
  const GFXfont* f = &SansSerif_plain_60;
  display.fillScreen(GxEPD_BLACK);
  display.setTextColor(GxEPD_WHITE);
  display.setFont(f);
  display.setCursor(40, 75);
  display.println("C");
}
void icons() {
  const GFXfont* f = &Meteocons_Regular_60;
  display.fillScreen(GxEPD_BLACK);
  display.setTextColor(GxEPD_WHITE);
  display.setFont(f);
  display.setCursor(10, 75);
  display.print("'");
  display.setCursor(10, 160);
  display.print("!");
}
void error() {
  const GFXfont* f = &Meteocons_Regular_60;
  display.fillScreen(GxEPD_BLACK);
  display.setTextColor(GxEPD_WHITE);
  display.setFont(f);
  display.setCursor(100, 100);
  display.print("8");

  const GFXfont* f2 = &SansSerif_plain_60;
  display.fillScreen(GxEPD_WHITE);
  display.setTextColor(GxEPD_RED);
  display.setFont(f2);
  display.setCursor(100, 180);
  display.print("Fehler!");
}

Could someone give me a simple example code with text, please?

fred260571

Hello Georg77cz

Could you share the schematics of your high voltage booster ?

Thank you
Frederic

Hi Jean-Marc,

I just want to post an update on my issues:

  • I had to use a different MOSFET in my high voltage booster, Good Display recommended to me to replace 2N7002K-7 by AO3400.
  • I connected the two Schottky rectifiers in reverse polarity  :smiley-eek-blue:
  • Bought an FPC breakout board to replace my custom soldered FPC connector



Now it is finally working, thanks! :)

ZinggJM

@heckiyt,

Quote
Now I don't understand how to mess with GxEPD2.
I don't know how to mess with GxEPD2 either.  But I would avoid to mix GxEPD with GxEPD2.
And I know nothing about GxEPD1. :)

I don't support Arduino Nano Every with GxEPD2 or GxEPD, as I don't have it.
If you want support for it, you can donate one to me.

Both GxEPD and GxEPD2 are quite flexible to use with any Arduino compatible processor board, you just need to find out which pins to use and which are the HW SPI pins.
Adapt the constructor to your pin usage, and take the constructor out of the conditional compile block if none of the conditional compile conditions match your processor, if you use GxEPD2.
Note that there are examples to help you get started, but examples are just examples, they don't cover every possible configuration or use.

I recommend to use GxEPD2 for Newbies or for new projects.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

heckiyt

Well, I know that this code is for GxEPD1. The problem I have is that I don't understand how to write text on my display like in my example code. Could you give me an example code that works like that one I posted above?

ZinggJM

#1760
Mar 14, 2020, 08:17 pm Last Edit: Mar 14, 2020, 08:21 pm by ZinggJM
Well, I know that this code is for GxEPD1. The problem I have is that I don't understand how to write text on my display like in my example code. Could you give me an example code that works like that one I posted above?
GxEPD2_PagedDisplayUsingCallback

And please read General Guidance and How to use the Forum

And don't cross-post! Moderators don't like that. https://forum.arduino.cc/index.php?topic=670635.msg4513804#msg4513804
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

heckiyt

Okay, thanks for the information. I'm new to the forum, so I don't know how the community works. :)

theodore_odore

Hi there!

I would like to get help for the update function of my "Waveshare 2.9inch e-Paper Module (B)"
I am using the display with the GxEPD2 library and an Ardunio Uno.


The update of the content of the display is done by the "partial update function" of GxEPD2 libary.
Works fine so far.



Some videos showing that it seems to be possible that e-paper displays can be very fast updated.
In addition it seems to be possible that only specific characters can be updated without the "boxed partial update function".


https://www.youtube.com/watch?v=SX922z-EFl8
https://www.youtube.com/watch?v=eKq5RabWmN0



Is this behaviour of the display showws in the videos also possible with the GxEPD2 library?
How can I use this update function?

Thank you,
Theo

ZinggJM

@theodore_odore,

welcome to the forum. If you have not done yet, please read General Guidance and How to use the Forum.

For posts concerning e-paper displays, posters should provide a clickable link to the e-paper concerned.

296x128, 2.9inch E-Ink display module, three-color

I also need to know the processor board used, Arduino UNO in your case, and the connection board used, which is the display board in your case, thank you.

You have a 3-color e-paper display. This kind of 3-color e-papers can't provide "fast partial update", aka differential update. See also Specifications on the Waveshare web-page:

Quote
Operating voltage: 3.3V/5V
Interface: 3-wire SPI, 4-wire SPI
Outline dimension: 89.5mm × 38mm
Display size: 66.89mm × 29.05mm
Dot pitch: 0.138 × 0.138
Resolution: 296 × 128
Display color: red, black, white
Grey level: 2
Full refresh time: 15s
Refresh power: 26.4mW(typ.)
Standby power: <0.017mW
Viewing angle: >170°
For an explanation see e.g. this post.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

theodore_odore

Hey,

thank you for the fast feedback!


I thought up to now, the "box update" I can see on the the display is the meant with the "partial update".
I didn't know "partial update" is the function to update only the characters which are changed like in the previously sent videos.


So, then I will order an e-paper with just b&w to get this "partial update" function.


Many thanks and best regards,
Theo

ZinggJM

Hi Theo,

maybe I should clarify this slightly. But the terminology is not always quite clear.

"partial update" is the capability to update a sub-window of the whole screen.
"partial update" can be the same speed as for full screen, with the flashing effect.
"partial update" can be "fast partial update" on b/w e-papers that provide differential update.
Differential update only changes the pixels that shall have a different color. The controller has a second buffer that allows to store the "previous" content of the screen, and uses a waveform table to drive only the particles of the pixels that need be moved.
Differential update can also be applied to the full screen.

Some vendors use the term "partial update" when they mean differential update.
So I started to use to call it "fast partial update" or differential update.
And "full update" for the flashing update.
Full update allows to get the desired result even if the previous content is unknown, e.g. after power-up.
Full update also allows to clear any ghosting that can occur after prolonged differential updates.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

flyingbaloon

Hi ZinggJM,
Hope you are doing well .

I am trying to drive 3.71 inch 4 gray scale epaper , with nucleo -L452RE using GxEPD2_4G . I have noticed that you added support for st's bluepill , is it possible to use nucleo-L452RE too?
thanks

ZinggJM

Hi ZinggJM,
Hope you are doing well .

I am trying to drive 3.71 inch 4 gray scale epaper , with nucleo -L452RE using GxEPD2_4G . I have noticed that you added support for st's bluepill , is it possible to use nucleo-L452RE too?
thanks
Yes, this should be easy. You need to find out or decide which pins to use and add a constructor line with the corresponding parameters, either outside the conditional compile blocks, or in a conditional compile block for STM32L4, e.g. in the example.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

flyingbaloon

Yes, this should be easy. You need to find out or decide which pins to use and add a constructor line with the corresponding parameters, either outside the conditional compile blocks, or in a conditional compile block for STM32L4, e.g. in the example.

Jean-Marc

Thanks , its working , the 4 gray bitmap from good display is showing fine ,I am now trying to display my custom bitmap . thanks again

theodore_odore

Many thanks again Jean-Marc!

This is really clarifying a lot for me!

Cheers,
Theo

Go Up