adafruit / Adafruit_CircuitPython_EPD

e paper driver for circuit python
MIT License
41 stars 19 forks source link

Adafruit_EPD.INVERSE not supported #24

Closed cogliano closed 5 years ago

cogliano commented 5 years ago

IMG_20190821_114147 I don't see Adafruit_EPD.INVERSE mentioned anywhere in the code other than the definition. It should, like the Arduino version, invert the color of the specified pixel, either black to white or white to black. It appears to act as WHITE when used.

Here is a code snippet I wrote that can be used to test:

# inverse test
def inverse_test(display, x, y, width, height, inversemode):
    for i in range(10):
        if inversemode:
            color = Adafruit_EPD.INVERSE
        else:
            color = Adafruit_EPD.BLACK
            if i % 2 == 0:
                color = Adafruit_EPD.WHITE
        x2 = x + i * width // 20
        y2 = y + i * height // 20
        w = width - i * width // 10
        h = height - i * height // 10
        display.fill_rect(x2, y2, w, h, color)

# main routine

display.rotation = 1
display.fill(Adafruit_EPD.BLACK)
inverse_test(display, 5, 5, 100, 100, False)
inverse_test(display, 110, 5, 100, 100, True)
display.display()

This displays concentric squares. The square on the left uses alternating white and black squares. The one on the right uses the INVERSE color, which does not work. Both squares should look the same.

ladyada commented 5 years ago

i dont think we support inverse and should delete it - wanna do a PR for that?

cogliano commented 5 years ago

Just created the PR