Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_border is not working #12

Closed
mattdesl opened this issue Dec 22, 2018 · 1 comment
Closed

set_border is not working #12

mattdesl opened this issue Dec 22, 2018 · 1 comment

Comments

@mattdesl
Copy link

mattdesl commented Dec 22, 2018

The set_border colour is not working as expected for me. Below is a simple program in which I would expect the border color to turn white, but it doesn't.

#!/usr/bin/python
from PIL import Image
from inky import InkyPHAT

display = InkyPHAT("black")

def get_filled_image (color):
  img = Image.new("P", (display.WIDTH, display.HEIGHT))
  for x in range(display.WIDTH):
    for y in range(display.HEIGHT):
      img.putpixel((x, y), color)
  return img

img = get_filled_image(display.WHITE)
display.set_border(display.WHITE)
display.set_image(img)
display.show()

At first I thought this was some sort of hardware limitation, but while hacking around with the lookup tables I managed to get a pretty nice update that entirely fills the screen with black or white. To solve this, I created a new lookup table that, instead of drawing the correct black or white pixels in phase 3, just draws pure black or pure white pixels. The result is that the border finally turns white.

@Gadgetoid
Copy link
Member

Looks like the register settings I was using for setting border colour were all kinds of wrong. I've tackled them with a bit of trial-and-error magic and come up with something that seems to work on Black, Yellow and Red units.

Gadgetoid added a commit that referenced this issue Jan 30, 2019
Fix for #12 across all WHAT and PHAT types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants