This demo shows how to realize a simple algorithm for a pattern lock with an ILI9341 touchscreen and the Arduino IDE.
The demo was written for the AZ-Touch. The AZ-Touch MOD (for ESP32 DEV KIT C), the AZ-Touch MKR (for Arduino MKR) or the AZ-Touch Feather can be used as hardware. Of course you can also simply connect an ILI9341 based touch screen with jumper wires to a microcontroller board and adapt the code accordingly.
Install the following libraries through Arduino Library Manager
Adafruit GFX Library https://github.com/adafruit/Adafruit-GFX-Library/archive/master.zip
Adafruit ILI9341 Library https://github.com/adafruit/Adafruit_ILI9341
XPT2046_Touchscreen by Paul Stoffregen https://github.com/PaulStoffregen/XPT2046_Touchscreen/blob/master/XPT2046_Touchscreen.h
You can also download the library also directly as ZIP file and uncompress the folder under yourarduinosketchfolder/libraries/
After installing the Adafruit libraries, restart the Arduino IDE.
You can find the latest version of the code and the description of the hardware at https://www.hwhardsoft.de/english/projects/arduitouch-mkr/
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA