-
Notifications
You must be signed in to change notification settings - Fork 9
Please add rotation to Touchscreen #7
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
Comments
So I just got an update pointing me to this option being setup via the # -------Rotate 0:
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR,
board.TOUCH_YD, board.TOUCH_YU,
calibration=((5200, 59000), (5800, 57000)),
size=(320, 240))
# -------Rotate 90:
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_YU, board.TOUCH_YD,
board.TOUCH_XL, board.TOUCH_XR,
calibration=((5200, 59000), (5800, 57000)),
size=(240, 320))
# ------Rotate 180:
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XR, board.TOUCH_XL,
board.TOUCH_YU, board.TOUCH_YD,
calibration=((5200, 59000), (5800, 57000)),
size=(320, 240))
# ------Rotate 270:
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_YD, board.TOUCH_YU,
board.TOUCH_XR, board.TOUCH_XL,
calibration=((5200, 59000), (5800, 57000)),
size=(240, 320)) Basically the It would be helpful to add something that selects the correct I also suggest adding more detailed documentation for what the parameters are responsible for in class: adafruit_touchscreen.Touchscreen(x1_pin, x2_pin, y1_pin, y2_pin, *, x_resistance=None, samples=4, z_threshhold=10000, calibration=None, size=None) Parameters:
There is actually some really helpful notes in the adafruit_touchscreen.py file that would have been supper helpful if I knew they were there.
|
yes! wanna add something to the readme or example? |
I think Adding the more detailed info about the I could also come up with an example for changing the orientation of the display and touchscreen that would let a user uncomment the correct orientation for the touchscreen. |
either way is fine by us :) |
@RichardA1 Are you still interested in working on this? |
I am a bit swamped with other stuff ATM, but I could try to figure it out at some point unless someone else more familiar wanted to give it a go. I am sure I could do it but not nearly as fast as someone with more Python experience. |
Just thought it'd be worth linking #8 since it's related and I don't think was ever linked. Edit: I don't actually have the hardware. I'll see about ordering some to do this. |
@RichardA1 I could work improving the documentation if you are not planning to. The example with the orientation example was merged. Let me know thanks 💯 |
I am not sure how it could be added to this library, but I created the following code to recalculate the touch coordinates based on the orientation of the screen set by board.DISPLAY.rotation. This fixes an issue with how the hotspots are setup from the Button() function used in Displayio.
The text was updated successfully, but these errors were encountered: