@ScruffR I’m trying to work with the b/w/r Waveshare display (already have working code running the b/w version based on Martin Schreiber’s code found here) but am finding your example library isn’t working. I commented out the two line that were preventing compilation (curious why you disabled set width/height) and I’m just getting gibberish on the display. Only difference in wiring is using D7 instead of D4. Any suggestions on what I’m doing wrong?
I have the Waveshare black/red/white 1.54" display working with my own code and modified versions of the Waveshare libraries. My code is very prototype oriented and messy so I am hesitant to share it since it might be difficult to understand.
You have to set the height and width since the power-up default for the controller is 96x230 and not 128x296. Your library should do this for you but you mentioned problems with height and width. See page 12 of this spec:
If you are not setting the size properly, you could be getting gibberish.
You also need 9472 bytes of bitmap storage for the two colors which is a lot so your program may be memory limited.
Well I read your code and parts seem OK but there is a lot going on for a first attempt at making it work. You have the IMAGE_BLACK and IMAGE_RED arrays declared extern which seems wrong since they are further down in the same file. You have a bunch of code dealing with the paint object which you will need later but I would start with just the const arrays for black and red (which will eventually need to be non-const). You call epd.DisplayFrame() and then call epd.DisplayFrame(IMAGE_BLACK, IMAGE_RED);.
I would remove all the paint object stuff for now and just call epd.DisplayFrame(IMAGE_BLACK, IMAGE_RED); and see if you can get an image that makes sense. It took me a while with the 1.54" display to figure out which direction was which at that is important since one direction is packet with 8 pixels per byte. I used my big image arrays to put boxes in the corners and then was able to figure out which direction was which. On my display 0xff is white and zero bits are black/red. My display takes 10-12 seconds to paint both black and red and my first attempts to update it were failing because I was trying to write to the display too quickly.