Skip to content

Add Touchscreen Calibrator Example #20

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

Merged
merged 3 commits into from
May 28, 2022
Merged

Add Touchscreen Calibrator Example #20

merged 3 commits into from
May 28, 2022

Conversation

CedarGroveStudios
Copy link
Contributor

@CedarGroveStudios CedarGroveStudios commented May 23, 2022

A simple CircuitPython DisplayIO resistive touchscreen calibrator for Adafruit built-in displays. To use, run as a standalone module, include the following line in the calling module, or type into the REPL:

import touch_calibrator_built_in

Operational paramaters such as screen rotation and REPL-only measurement display can be set in the operational paramaters portion of the module.

When the test screen appears, use a stylus to swipe to the four edges of the visible display area. As the screen is calibrated, the small red square tracks the stylus tip (when REPL_ONLY=False). Minimum and maximum calibration values will display on the screen and in the REPL. The REPL values can be copied and pasted into the target code's touchscreen instantiation statement.

The calibration values are measured for a display rotation of zero degrees. To use the calibration values in the target, correlate the touchscreen pins and the calibration values. The order of the calibration tuples is determined by the display rotation value.

For example, a calibration tuple of ((4951, 58951), (8080, 57071)) would be inserted into the display instantiation statement in the order shown, depending on display orientation:

touch_calibration_and_display_rotation

C72D1327-DFA4-46A8-81F8-DF03B54D3960

@tekktrik tekktrik requested a review from a team May 24, 2022 17:14
@FoamyGuy
Copy link
Contributor

I think we need the examples to follow the pattern of starting the filename with the name of the library so for example maybe touchscreen_calibrator_built_in.py

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.

Looks good to me. Thank you @CedarGroveStudios!

@FoamyGuy FoamyGuy merged commit 667f9d9 into adafruit:main May 28, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 29, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_Touchscreen to 1.1.11 from 1.1.10:
  > Merge pull request adafruit/Adafruit_CircuitPython_Touchscreen#20 from CedarGroveStudios/main
  > Switch to inclusive terminology
  > Increase min lines similarity
  > Patch .pre-commit-config.yaml
  > change discord badge
  > Patch: Replaced discord badge image
  > Updated gitignore
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README
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