You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/10.mega/shields/giga-display-shield/tutorials/basic-touch/basic-touch.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: Karl Söderby
5
5
tags: [Display, Touch Screen]
6
6
---
7
7
8
-
The [GIGA Display Shield](/hardware/giga-display-shield) has an advanced touch interface, supported via the [Arduino_GigaDisplayTouch]() library.
8
+
The [GIGA Display Shield](/hardware/giga-display-shield) has an advanced touch interface, supported via the [Arduino_GigaDisplayTouch](https://github.com/arduino-libraries/Arduino_GigaDisplayTouch) library.
9
9
10
10
This library is used to return the number of contact points, and the `x,y` coordinates for each of these. For example, touching the screen with two fingers somewhere on the screen would generate the following:
11
11
@@ -35,7 +35,7 @@ This library works with the [lvgl](https://github.com/lvgl/lvgl) framework, whic
35
35
36
36
***Learn more about how to use the lvgl framework with the GIGA Display Shield in [this tutorial](/tutorials/giga-display-shield/lvgl-guide).***
37
37
38
-
## Print Coordinates Example
38
+
## Coordinates Example
39
39
40
40
To retrieve the coordinates when touching the display, we can use the **Touch_Polling** example from the library. You will find it at **Arduino_GigaDisplayTouch > Touch_Polling** in the IDE (library needs to be installed), or you will find it just below:
41
41
@@ -50,9 +50,9 @@ Touch controller init - OK
50
50
Seeing this, you can start touching the display area with one or more fingers. The serial monitor will print out how many "contacts" aka fingers you are using, and the coordinates for each point. Here's an example response:
51
51
52
52
```
53
-
Contacts: 2
54
-
245 346
55
-
178 473
53
+
Contacts: 2 <---- two fingers used
54
+
245 346 <---- x = 245, y = 346
55
+
178 473 <---- x = 178, y = 473
56
56
```
57
57
58
58
In this case, we have two touchpoints, and the coordinates for each of them printed below (`x`,`y`). And that's pretty much it to obtain a successful reading from the touch interface.
@@ -61,4 +61,4 @@ You can use this to build customised gestures on the screen such as swiping two
61
61
62
62
## Summary
63
63
64
-
In this tutorial, we have explored the **Arduino_GigaDisplayTouch** library and tested out an example that allows us to read the coordinates of our touches.
64
+
In this tutorial, we have explored the **Arduino_GigaDisplayTouch** library and tested out an example that allows us to read the coordinates of our touches. This library is essential for developing sophisticated touch displays using the lvgl framework.
0 commit comments