pappersverk / inky

A library for managing Inky e-ink displays from Elixir.
Apache License 2.0
72 stars 11 forks source link

display orientation upside down #43

Open mnishiguchi opened 3 years ago

mnishiguchi commented 3 years ago

The display orientation is upside down compared to how Pimoroni uses Inky. It is fine when we use Inky standalone, but a problem may arise when we want to use something like Adafruit CYBERDECK Bonnet for Raspberry Pi 400.

It would be nice if the orientation is consistent with Pimoroni's settings, but probably it will require some breaking changes, meaning users existing code for Inky will be upside down suddenly.

This library Pin header at the bottom

Pimoroni (pimoroni/inky) Pin header at the top

Adafruit CYBERDECK Bonnet for Raspberry Pi 400 Pin header at the top

mnishiguchi commented 3 years ago

It seems like possibly all it takes is flipping the negative/positive sign.

Screen Shot 2021-11-08 at 8 53 05 AM
nyaray commented 3 years ago

Flipping the rotation shouldn't do anything with your display, the default rotation is 0, I'm not sure why you're seeing a flipped rotation have an effect.

Have you verified that they have not drawn upside down pictures in their product photos? I'm wondering if this is an issue for us or not, since someone working with the pimoroni code will be working in another language anyway.

mnishiguchi commented 3 years ago

Honestly, I do not know what is going on, but I am just following the manufacturer's examples code and the same logic did not work. It is not side effect. The two libraries interpret coordinates differently and I was confused as a Display beginner.

Yeah if we see this library just different, then the user just needs to get used to it. It is more about a decision than an issue. I personally resolved this by the - in my fork (so I am happy 😄 ) but for the library it depends on what is required.

https://learn.pimoroni.com/article/getting-started-with-inky-phat https://github.com/pimoroni/inky/blob/master/examples/name-badge.py

nyaray commented 3 years ago

Honestly, I do not know what is going on, but I am just following the manufacturer's examples code and the same logic did not work. It is not side effect. The two libraries interpret coordinates differently and I was confused as a Display beginner.

Hm, I think I found that your SSD1608 implementation defaults to 90 degrees, which also makes it clear why there wasn't a problem with the width/height vs rows/cols I commented about earlier. Two wrongs made a right, unless I'm having a brain fart moment, hehe.

Yeah if we see this library just different, then the user just needs to get used to it. It is more about a decision than an issue. I personally resolved this by the - in my fork (so I am happy smile ) but for the library it depends on what is required.

https://learn.pimoroni.com/article/getting-started-with-inky-phat https://github.com/pimoroni/inky/blob/master/examples/name-badge.py

Yeah, it's worth thinking about what the default orientation should be. @lawik do you remember if we talked about this? I kind of remember that "default is whatever the hardware says" was a comment made at some point, but this issue points out why that might be an issue. Worth thinking about a bit, I guess!

mnishiguchi commented 3 years ago

@lawik Here is my livebook notebook I used for the name badge example. It is my current best based on all the techniques I learned from your Youtube video. https://gist.github.com/mnishiguchi/7acf189376a4c5ffa184c39372cafbf4