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

Limit x and y values to pixel address maximum #25

Merged
merged 1 commit into from
May 1, 2023
Merged

Limit x and y values to pixel address maximum #25

merged 1 commit into from
May 1, 2023

Conversation

CedarGroveStudios
Copy link
Contributor

@CedarGroveStudios CedarGroveStudios commented Apr 29, 2023

Limit x and y values to the maximum pixel address rather than screen size. Prevents the touchscreen from generating a pixel address greater than the displayable area.

Tested with CircuitPython v8.0.5 on a PyPortal using touchscreen_simplest.py from the examples folder.

Limit x and y values to the maximum pixel address rather than screen size. Prevents the touchscreen from generating a pixel address greater than the displayable area.
@tekktrik tekktrik requested a review from a team May 1, 2023 13:39
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, the pixels are 0 based so 320px width should yield possible values 0-319.

I tested this successfully on a PyPortal Titano with simpletest and the calibration script in the examples folder. I found that using the calibration outputted by that script I rarely see the absolute bounds of the coordinates. Most typically I can get down to low single digits on left / top or a few pixels < then the maximum on right and bottom.

Using the stock "best guess" calibration values hard-coded in the simpletest script I am able to get readings of exactly x:320 and confirmed with the version from this PR that they are instead correctly limited to 319.

Thanks for the fix @CedarGroveStudios

@FoamyGuy FoamyGuy merged commit 3e46e10 into adafruit:main May 1, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 2, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_ATECC to 1.2.17 from 1.2.15:
  > Merge pull request adafruit/Adafruit_CircuitPython_ATECC#33 from FoamyGuy/fix_docs
  > Merge pull request adafruit/Adafruit_CircuitPython_ATECC#31 from brass75/issue_25/missing-typehints
  > Add upload url to release action
  > Add .venv to .gitignore
  > Update .pylintrc for v2.15.5
  > Fix release CI files
  > Update pylint to 2.15.5
  > Updated pylint version to 2.13.0
  > Switching to composite actions

Updating https://github.com/adafruit/Adafruit_CircuitPython_LC709203F to 2.3.0 from 2.2.11:
  > Merge pull request adafruit/Adafruit_CircuitPython_LC709203F#25 from jrrickerson/config_voltage_alarm

Updating https://github.com/adafruit/Adafruit_CircuitPython_RockBlock to 1.3.12 from 1.3.11:
  > Merge pull request adafruit/Adafruit_CircuitPython_RockBlock#30 from zachariahpifer/add-type-annotations
  > Add upload url to release action
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCS34725 to 3.3.17 from 3.3.16:
  > Merge pull request adafruit/Adafruit_CircuitPython_TCS34725#42 from zemyblue/feat/support_tcs34727
  > Add upload url to release action
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_Touchscreen to 1.2.1 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Touchscreen#25 from CedarGroveStudios/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 2.5.0 from 2.4.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#95 from BiffoBear/new_dhcp_state_machine

Updating https://github.com/adafruit/Adafruit_CircuitPython_MacroPad to 2.2.0 from 2.1.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_MacroPad#44 from kalehmann/feature/display_sleep
  > Add upload url to release action
  > Update .pylintrc for v2.15.5
  > Fix release CI files
  > Update pylint to 2.15.5
  > Updated pylint version to 2.13.0
  > Switching to composite actions

Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO to 3.0.10 from 3.0.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_SimpleIO#67 from RossK1/adding_type_hints
  > Add upload url to release action
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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

Successfully merging this pull request may close these issues.

2 participants