Closed cdsupina closed 1 year ago
That's an odd combination of color switching. What happens if you use ColorOrder::Bgr
?
I changed the color mode to BGR:
...
.with_color_order(mipidsi::ColorOrder::Bgr)
...
It looks after changing that line of code, the large square changed to dark blue and the pixel turned to a light blue or cyan color.
This is really odd. I've had things like Rgb/Bgr inverted before, but not this kind of odd shift. If you do Rgb again, can you try drawing "red" then "green" then "blue" squares in different places to see what comes up? I'm trying to wrap my head around what the "transformation" is.
Maybe this has something to do with it? https://github.com/almindor/mipidsi/blob/master/src/models/st7735s.rs#L39-L40
Maybe this has something to do with it? https://github.com/almindor/mipidsi/blob/master/src/models/st7735s.rs#L39-L40
Good find, I'm not sure why the model author put that there twice, I'm guessing it's just a C&P bug.
@cdsupina could you please check out PR #34 to see if things work with that? I don't have this model to test with.
There must be something else that's causing this issue. With my display the master
branch outputs the correct colors and removing the INVON
command causes the display to be inverted.
There must be something else that's causing this issue. With my display the
master
branch outputs the correct colors and removing theINVON
command causes the display to be inverted.
Hmm then it's really odd. I'll remove the duplicate call in master at least.
@rfuest could you check with current master, just to be 100% sure that the double invon didn't cause some odd behaviour.
The current master version works as expected.
I did some research and found that some code that contains INVON
in the init sequence and other code doesn't. This might just need to be a configuration option.
The datasheet contains this sentence in the features section: -Support both normal-black & normal-white LC
. Maybe this is the reason the display inversion feature exists.
The current master version works as expected.
I did some research and found that some code that contains
INVON
in the init sequence and other code doesn't. This might just need to be a configuration option.
Good point. I don't think the colors @cdsupina sees are "correct" in either setting so I'll keep this issue and make a separate one for the invert move to options/builder.
I don't think the colors @cdsupina sees are "correct" in either setting so I'll keep this issue and make a separate one for the invert move to options/builder.
OK, makes sense. I think that removing INVON
and setting the color order to Bgr
should result in the correct colors in their case.
My testing confirms what @rfuest says. Using the st7735s_uninverse
branch and changing the color order to BGR makes the display appear as it should.
My testing confirms what @rfuest says. Using the
st7735s_uninverse
branch and changing the color order to BGR makes the display appear as it should.
Good to hear, thanks for confirming. I will try and create a fix for #35 so this can be configured properly.
I'm using a 128x160 ST7735 display and I'm noticing that the colors appear to be inverted.
display.clear(Rgb565::WHITE);
makes the whole display black,display.set_pixels(1, 1, 10, 10, core::iter::repeat(Rgb565::YELLOW).take(100));
draws a 10x10 red squaredisplay.set_pixel(11, 11, Rgb565::RED);
draws a single yellow pixel at coordinate (11, 11)I think that I am setting up the display correctly, below is the code used to create the display as shown in the attached image.