A lot of customers asked us for a very simple code example for ArduiTouch to test their work and also as starting point for own developments. This very simple codelock will demonstrate the basic functions of ArduiTouch without any bells and whistles.
Please follow for the assembly of the ArduiTouch MKR our construction manual for ArduiTouch MKR.
We have to plug the Arduino MKR board into the marked slot on the backside of the ArduiTouch PCB:
Please install the following libraries through Arduino Library Manager.
XPT2046_Touchscreenby Paul Stoffregen
You can download the library also directly as ZIP file and uncompress the folder under yourarduinosketchfolder/libraries/
After installing the Adafruit libraries, please restart the Arduino IDE.
Custom settings:In the source code you can set the code number :
#definecodenum 42
42is the answer for everything, but you can change this to any number between 0 and 999999.
Furthermore you can set the switching time of the optional relay there:
#definerelay_on_time40
Run the demo:Please open this sample in the Arduino IDE. After compilation and upload you will see the keypad. Now you can enter a code number and confirm with„OK“ button.
Comments
Please log in or sign up to comment.