A simple CircuitPython resistive touchscreen calibrator for Adafruit built-in and TFT FeatherWing displays.
On-screen touchscreen calibrator for built-in and TFT FeatherWing displays. To use, run as a standalone module, include the following line in the calling module, or type into the REPL:
import touchcalibrator.built_in
for built-in displays or
import touchcalibrator.featherwing
for TFT FeatherWing displays.
Operational parameters such as screen rotation and REPL-only measurement display
can be set in the operational parameters
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 calling code's touchscreen instantiation statement.
Touchscreen Instantiation example code for built-in displays. The order of the calibration tuples is determined by the display rotation value:
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
Make sure that you have circup
installed in your Python environment.
Install it with the following command if necessary:
pip3 install circup
With circup
installed and your CircuitPython device connected use the
following command to install:
circup install cedargrove_touchcalibrator
Or the following command to update an existing version:
circup update
For information on building library documentation, please check out this guide.
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.