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

Add rotation #66

Open
wants to merge 15 commits into
base: master
from
Open

Add rotation #66

wants to merge 15 commits into from

Conversation

@TG-Techie
Copy link

TG-Techie commented Jan 17, 2020

add hardware rotation support across all board (if enabled and configured in subclasses)
also, add rotation (with offsets there too) to the simplest so make sure people know it exists

the additions auto re-configure the x/y offsets based on their initial inputs, relative to the 0-degree rotation. Adding rotation to all the boards should be "relatively easy". only one function needs to be implemented. (the above statement is dependent on hardware complexity / ease)

has been tested on hardware but some extra testing wouldn’t hurt. especially if there are st7789 with non-square ratios.

TG-Techie added 5 commits Jan 14, 2020
@TG-Techie TG-Techie requested review from makermelissa and sommersoft Jan 17, 2020
@makermelissa

This comment has been minimized.

Copy link
Contributor

makermelissa commented Jan 17, 2020

What happens if you change the rotation via the property setter?

@TG-Techie

This comment has been minimized.

Copy link
Author

TG-Techie commented Jan 17, 2020

ah! I missed it the first time around. I ended up implementing a universal solution.

@TG-Techie

This comment has been minimized.

Copy link
Author

TG-Techie commented Jan 17, 2020

description updated^

ah "# pylint: disable=too-many-branches" has to be at the top of the function it's affecting.

TG-Techie added 2 commits Jan 17, 2020
@FoamyGuy

This comment has been minimized.

Copy link

FoamyGuy commented Jan 24, 2020

I tried out this version of the library with a Feather M4 + 2.4" Featherwing. I am getting this error when I attempt to run the library sample code:

  File "/lib/adafruit_rgb_display/ili9341.py", line 94, in __init__
  File "/lib/adafruit_rgb_display/rgb.py", line 568, in __init__
  File "/lib/adafruit_rgb_display/rgb.py", line 163, in __init__
  File "/lib/adafruit_rgb_display/rgb.py", line 618, in rotation
Exception: rotation not currently supported for this display, see datasheet

I tried setting rotation=False in the ili9341.ILI9341() constructor and then I end up with this error instead:

  File "/lib/adafruit_rgb_display/ili9341.py", line 94, in __init__
  File "/lib/adafruit_rgb_display/rgb.py", line 568, in __init__
  File "/lib/adafruit_rgb_display/rgb.py", line 163, in __init__
  File "/lib/adafruit_rgb_display/rgb.py", line 612, in rotation
ValueError: angle must be an 'int' mulitple of 90
Copy link
Contributor

makermelissa left a comment

Please fix it so it doesn't break the examples as @FoamyGuy pointed out. Thanks

@TG-Techie

This comment has been minimized.

Copy link
Author

TG-Techie commented Feb 12, 2020

Sure. I will get on it

@FoamyGuy

This comment has been minimized.

Copy link

FoamyGuy commented Feb 13, 2020

The updated version no longer throws an exception on Feather M4 + 2.4" Featherwing. I tried with and without rotation=False parameter and both work. Out of curiousity I tried the possible values for the rotation parameter. I assume nothing is expected to work since the error before stated this screen does not support. Rotation values of 0 and 180 have no effect. With it set to 90 and 270 the red dot in the simpletest appears normal, but the blue "wipe" does not make it all the way off of the screen about 1/4 of the screen remains blue always. Odd, but perhaps not a big problem since this screen appears unsupported.

@TG-Techie

This comment has been minimized.

Copy link
Author

TG-Techie commented Feb 13, 2020

@FoamyGuy

This comment has been minimized.

Copy link

FoamyGuy commented Feb 13, 2020

@TG-Techie Sorry I'm not sure which offsets you mean. I am using the "Usage Example" from the readme file. The only thing in that code that seem like offsets to me are the x,y coordinates of the red dot. I did tweak those a bit to push it off to one side instead of being in the center and that seems to work fine under all rotation values. The fill() function draws the black before the red pixel, and the blue after it. I don't see any offsets associated with fill(). About 1/4 of my screen is staying blue so when it calls display.fill(0) it is only filling 3/4 of the screen with black, and leaving the other 1/4 blue from before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.